in reply to Re: Missing event from InlineStates in POE::Component::Server::TCP
in thread Missing event from InlineStates in POE::Component::Server::TCP

I did not understand that POE::Component::Server::TCP->create( Alias => ... ) refers to to the listening server session and that InlineStates is declaring events for its children. I get it now. So instead of one TCPServer session I really have one parent TCPServer session and lots of children.

How then do I register events for the hub server? I thought I should store stuff for it in its heap instead of just some global.

  • Comment on Re^2: Missing event from InlineStates in POE::Component::Server::TCP
  • Download Code

Replies are listed 'Best First'.
Re^3: Missing event from InlineStates in POE::Component::Server::TCP
by rcaputo (Chaplain) on Jul 06, 2004 at 17:17 UTC

    Heaps are just session-scoped hash references. Consider them like $self, but they're kept aside for your event handlers to use.

    You certainly can use them for inter-session storage, but it won't be as practical as setting aside a plain hash. Consider that your accessors would need to be event-based, which makes them insanely slow compared to $hash{foo} = 1 or just incredibly slow compared to $object->set_foo(1).

    -- Rocco Caputo - http://poe.perl.org/