Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: POE: post an event on tcp server from a session

by Solo (Deacon)
on Jul 26, 2005 at 13:01 UTC ( [id://478163]=note: print w/replies, xml ) Need Help??


in reply to POE: post an event on tcp server from a session

Typo in the event name.

inline_states => { ... Send_updates => \&send_update, ... # later $kernel->yield('Send_update');

Correcting that leads to a newer problem, though.

a 'Update_clients' event was sent from pmtest.pl at 57 to session 2 (T +OF) but session 2 (TOF) has neither a handler for it nor one for _default

But the event names look correct in this case, so InlineStates must not behave the way you expect in this component. Looking at the source for POE::Component::Server::TCP it seems the InlineStates are not added to the 'listener' PoCo::Server::TCP session, but only to sessions spawned by the default Acceptor handler which is used when one is not provided by the caller. In any case, the session 'TOF' would not get the InlineStates, it's children would. There doesn't seem to be an easy way to add additional states to the listener at creation. But I only took a quick look at the source.

--Solo

--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://478163]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-29 01:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found