perlquestion
diotalevi
<p>The following error occurs when I run this script. The AddPublisher state is declared in [cpan://POE::Component::Server::TCP]->create( InlineStates => { ... } ). What is wrong that I am getting this error and why is it not triggering a fatal assertion?</p><code>a 'AddPublisher' state was sent from poe at 13 to session 2, but session 2 has neither that state nor a _default state to handle it
POE::Component::Server::TCP->new( Alias => 'TCPServer',
...
InlineStates => {
AddPublisher => sub {} } ;
$_[KERNEL]->post( TCPServer =>
AddPublisher =>
$_[SESSION],
1 ); },</code><p>The script at ~diotalevi/poe2</p><readmore><code>sub POE::Kernel::ASSERT_DEFAULT () { 1 }
use POE qw( Session
Component::Server::TCP );
POE::Component::Server::TCP->new( Alias => 'TCPServer',
Port => 53511,
InlineStates => {
AddPublisher => sub {} },
ClientInput => sub {} );
POE::Session->create( inline_states =>
{ _start => sub {
$_[KERNEL]->post( TCPServer =>
AddPublisher =>
$_[SESSION],
1 ); },
_stop => sub {} } );
POE::Kernel->run;</code></readmore>