in reply to Knowing when a socket connection is dead

It's dead (disconnected), when can_read() indicates data available, but reading from it gives you no bytes. (See im2 code). I forget where I picked that up from, but it's worked for me. Why are you not using IO::Socket, btw?

C.

  • Comment on Re: Knowing when a socket connection is dead

Replies are listed 'Best First'.
Re^2: Knowing when a socket connection is dead
by kscaldef (Pilgrim) on Jul 29, 2005 at 16:17 UTC
    If you want to be completely sure, you need to do a little more checking. At the least, you should check if $! is EINTR. In that case, you got no data because the system call was interrupted.