in reply to How do I close a POE SocketFactory Socket?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I close a POE SocketFactory Socket?
by Declarent (Sexton) on Jun 24, 2002 at 23:22 UTC | |
by rcaputo (Chaplain) on Jun 25, 2002 at 00:15 UTC | |
by Declarent (Sexton) on Jun 25, 2002 at 15:25 UTC | |
by rcaputo (Chaplain) on Jun 27, 2002 at 05:37 UTC |