![]() |
|
good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
The problem is that the my $handle variable is private to the callback sub, and is not referenced anywhere else. So when that sub returns (immediately after push_writing your "Hello" message), it will be destroyed, and with it, your connection. A solution is including a reference to it in one of AE::Handle's callbacks, e.g.:
This way, the callback sub closes over the variable, so its reference count will be nonzero when the sub returns and thus your connection will stay alive. In reply to Re: AnyEvent tcp_server not working
by kikuchiyo
|
|