Lorenzo Thurman
2007-08-19 04:18:57 UTC
I'm playing around with socket programming and have found a few
tutorials in the 'net, but I have a question that they don't seem to answer:
What's the proper way to close a connection? I use close(fd), but if I
try to restart the server app, I get the error that the socket is in
use. netstat confirms the port is in TIME_WAIT and it eventually becomes
available again, but most server apps (apache, mysql, etc) can be
restarted without such a delay. How do I accomplish this?
TIA
tutorials in the 'net, but I have a question that they don't seem to answer:
What's the proper way to close a connection? I use close(fd), but if I
try to restart the server app, I get the error that the socket is in
use. netstat confirms the port is in TIME_WAIT and it eventually becomes
available again, but most server apps (apache, mysql, etc) can be
restarted without such a delay. How do I accomplish this?
TIA