On 03-Mar-2005 Vladimir M wrote:
> Hello, All
> 
> Sorry for my terrible english.
> 
> Take a server and client from
> http://poe.perl.org/?POE_Cookbook/Application_Servers_2
> Save server untouched, and try to connect to IKC::Server from 2
> clients simultaneously


OK, I've looked at this and I was 100% out to lunch with my answer 2 weeks
ago.  The problem is with the server in the cook book.

Specifically the line 

        $kernel->delay( did_something => 1, $rsvp, $sum );

This is called each time you all 'calc_sum'.  The problem is that if a new
request arrives before the first delay is finished, the first delay is
deleted.  Quoth the docs :

       # Post an event which will be delivered after a delay, specified in
       # seconds hence. This clears previous timed events with the same
       # name.
       $kernel->delay( $event, $seconds, @event_args );

Change the line to 

    $kernel->yield( did_something => $rsvp, $sum );
or
    $kernel->delay_set( did_something => 1, $rsvp, $sum );

And your example works.  I've fixed the Wiki.

Sorry I took so long to look into this,

-Philip


Reply via email to