Jay Strauss wrote:
Hi,
I have a POE::Component::Server::TCP. I'd like to prevent connections under
certain circumstances, even though I'm still in the event loop. Is there a
way to do this? That is I want my program to run, I just don't want to
allow connections at certain times.
Thanks
Jay
I think everyone in here missed one easy way: the shutdown event...
sub shutdown_server {
$_[KERNEL]->post( 'tcpserver', 'shutdown' );
}
sub restart_server {
# just call your normal server instantitation code here
}
# Of course this won't work but gives you an idea :)
if ( ! connected_stocks() ) {
$_[KERNEL]->yield( 'shutdown_server' );
}
--
Apocalypse
Homepage: http://JiNxEdStAr.0ne.us
IRC: [EMAIL PROTECTED]
IRC: [EMAIL PROTECTED]
CPAN ID: APOCAL