Oh yes, I did it! It came to mind that the server shuts down after all sessions have been shut down. My own session was still open. So the solution is:
elsif ($input eq "/shutdown") { # user entered /shutdown $poe_kernel->post($session_id => send => "don't do that!"); $kernel->yield("shutdown"); # <<< CLOSE MY SESSION $kernel->call('chat_server', 'shutdown'); return; }
That was simple. Of course this should be improved: I should close all sessions, not only mine. After sending them a message informing them about the shutdown, off course. :-)
I am used to the Lua programming language which is similar to Perl (no, I'm not provoking discussion about similarities and differences), and I'm trying to switch to Perl. With Lua and the LuaCopas module, one isn't able to stop sessions without shutting down the program itself, as far as I know. It uses a coroutine for every session. So I wasn't used to that. :-)
To me this case is closed. I'm not sure about jsarrel's problem.
About my epoll question, I'll continue my research...
In reply to Re^3: POE - can't shutdown Component::Server::TCP from Component::Client::TCP
by pacow
in thread POE - can't shutdown Component::Server::TCP from Component::Client::TCP
by jsarrel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |