Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 18665
Status: resolved
Priority: 0/
Queue: POE

People
Owner: RCAPUTO [...] cpan.org
Requestors: isaacson [...] cpan.org
Cc: david.lillie [...] morganstanley.com
merijn.broeren [...] morganstanley.com
AdminCc:

Bug Information
Severity: Important
Broken in: 0.34
Fixed in: (no value)



CC: david.lillie [...] morganstanley.com,merijn.broeren [...] morganstanley.com
Subject: PoCo::Client::TCP sometimes doesn't send Disconnected callback
When handling a shutdown event, PoCo::Client::TCP will call the user's Disconnected callback only if "not $heap->{server}- Show quoted text
>get_driver_out_octets()" -- i.e., if there's no buffered output.
Let's say you want to explicitly close the TCP connection, so you do: $poe_kernel->call ($tcp_session, 'shutdown'); This will lead to the connection getting torn down, but if there is buffered output at the time, the shutdown event won't call $disc_callback, and it doesn't look like there's any provision for doing it later (after the output buffer gets flushed). I think the fix is to replace this line in got_server_flush: delete $heap->{server} if $heap->{shutdown}; with: if ($heap->{shutdown}) { delete $heap->{server}; $disc_callback->(@_); } so got_server_flush cleans up after shutdown in this case.
Thank you for the bug report. Apocalypse has committed a fix for it: Revision: 1941 Author: apocal Date: 2006-04-29 10:27:08 -0700 (Sat, 29 Apr 2006) ViewCVS: http://svn.sourceforge.net/poe/?rev=1941&view=rev Log Message: ----------- #18665: PoCo::Client::TCP sometimes doesn't send Disconnected callback The reasoning is sane, and the code's updated to send it in the special case