> hiya.. i need information about linux sockets programming, something
> that cover up alot of information.
Anything by Douglas Comer and David Stevens.
Peter Buelow - Software Engineer
"Finger to spiritual emptiness underlying everything." -- How a C manual
referred to a "pointer to void."
I have a process that opens a TCP server socket via socket/bind/listen.
Sometimes the process dies unexpectedly. When I try to start another
process to bind to the same port, I get EADDRINUSE returned from bind;
the socket is already in use, even though the other process that had
it open is dead. After about 30 seconds, though, I can bind to that
I know almost all Unix kernels do this, but why? Is there some sort of
garbage collection process in the kernel that occasionally checks all
sockets that are marked in use to check that they really are?
What should I be doing in my own server process to ensure that it
closes the socket properly so Linux doesn't think the socket is in use?