Broken Sockets

Larry Griffin (
Tue, 21 Dec 1999 09:54:09 -0600

Dear Experts
Does anyone know of a FAQ or example page for detecting and recovering
from broken sockets (both write and read)?

I have a Linux based application that gathers data around the clock and
forwards it via sockets. I need it to be real solid so I can sleep at

In my write experiments I have ignored SIGPIPE and grab the error but
there are two problems. Write doesn't notice a problem until the second
message is sent and closing the file descriptor still doesn't allow me
to open a new connection to the server. It says the port is still in
use even when the server is dropped and comes back up.

I'm experimenting with the read side now, but was hoping there is
someplace out there that gets into detail on this subject. There are
many examples on the net that say something like "error handling here".
My stack of books on Linux and Unix networking development also seem to
skirt this issue.
Larry Griffin
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to