diff options
author | Yorhel <git@yorhel.nl> | 2012-04-20 15:45:21 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2012-04-20 15:45:21 +0200 |
commit | 79a19c12da1869a0cafd323a4231261e75a827a2 (patch) | |
tree | cb2ed167bba4637cfde1486abb4ca99e1614dad3 | |
parent | 51e3c106a15b4f87fb06304a683f90be1f322872 (diff) |
The postpone of close() is necessary to allow stuff like
$ses->send(..);
$link->close();
Since a ->send() uses postpone to queue the messages.
-rw-r--r-- | Tanja.pm | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -265,9 +265,11 @@ sub _err { sub close { - $_[0]->_cleanup; - $_[0]->{write_handle}->push_shutdown; - $_[0]->{read_handle}->push_shutdown; + my $s = shift; + AnyEvent::postpone { + $s->_cleanup; + $s->{write_handle}->push_shutdown; + }; } |