How does one shutdown a socket created by PoCo::TCP::Server?

I am noticing some SOAP::Lite client hangs.  Netstat shows that the
server is at a close wait state, and the client is at fin wait state.

Saving the socket passed into the the handler session in $heap->{socket}
and later calling shutdown($heap->{socket}, 1) in the ClientFlushed
state solved the problem for me.  It seems that just deleting the
Wheel::ReadWrite is not sufficient to shutdown the socket.  Also the
assumption seems to be that the client will disconnect first.

This is somewhat of a problem with SOAP::Lite.  Apparently (based on my
observation, not the code) a SOAP::Lite client will wait for a response
until it detects a read EOF.  This means the server must do
shutdown($socket, 1) first.

I am not sure whether my deduction is completely accurate though.  It
surprises me that such cases haven't come up, which makes me wonder
whether I am missing something here.

Perhaps others with more experience with POE and socket programming can
shed some light on the subject.  Thanks in advance.

Pete


Reply via email to