Wheels are meant to manage the things they're working with. Usually those are filehandles, as in the cases of SocketFactory, ListenAccept, FollowTail, ReadWrite, and Run. Normally you needn't hold copies of the handles themselves, but it can be handy when you want a handle to persist beyond the lifetime of its wheel.
Anyway, closing handles is very easy: Just delete all copies of the wheels that wraps them. When wheels are DESTROYed, the handles embedded within them usually are too.
sub agent_error { print "Got an agent error, exiting agent session!\n"; my ($function, $error) = @_[ARG0, ARG2]; print "SERVER: call to $function() failed: $error.\n"; # I sure would like to close the socket here... delete $_[HEAP]->{readwrite}; }
-- Rocco Caputo / poe.perl.org / poe.sf.net
In reply to Re: How do I close a POE SocketFactory Socket?
by rcaputo
in thread How do I close a POE SocketFactory Socket?
by Declarent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |