I've got a piece of code taken from the cookbook...

  POE::Component::IKC::Server->spawn(
    port  => $listen_port,
    name  => 'WorkerBee'
  );

I need to die if it fails to set up a server connection because the address is in use. The only way I can see to do this is by subclassing and rewriting the subroutine 'error'. I must be missing something obvious.

I suppose I could also use $SIG{__WARN__}...  Hmm.

$SIG{__WARN__} = sub { $_[0] =~ /in use/i ? die shift : warn shift };

I don't really like either solution. Is there some way to to check the state of the session to see if that session's heap's die flag has been set?

Rob

Reply via email to