note
kschwab
Using sysread(), your indication that the other end
has closed the connection would be a "successful sysread
of zero bytes". This works when the other end does an
orderly close() or shutdown() of the send side of
the socket. So, you would have to test the return
value of sysread() for undef (error) and zero( end of
file, a.k.a, client closed connection ).<p>
In the event that something unusual happens ( perhaps
the client crashed ?), keepalives could be helpful.
(<code>$sockobj->sockopt(SO_KEEPALIVE,1);</code>)
280876
280876