Discussion:
Netstat says "CLOSE_WAIT"
lloy0076
2004-04-19 00:55:47 UTC
Permalink
If I have a TCP connection saying "CLOSE_WAIT" as its state the manual
says that the remote end has shutdown and is waiting for the socket on
this end to close. However, at the moment I can't close the socket
because Netscape helpfully died on me.

I know the local IP address, where the socket belongs and which port
number it is on. This is to say I have sufficient information to specify
exactly which socket I want to operate on. Is there any tool/command to
forcibly close a TCP/IP socket???

DAVID
[i.e. I have root access if I need it]
--
The Linux C Mailing Lists Have Moved
mailto:linuxCprogramming-***@i-docs.net?subject=subscribe
The Linux C++ Mailing Lists Have Moved
mailto:tuxCPProgramming-***@i-docs.net?subject=subscribe
--
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
mail linuxsa-***@linuxsa.org.au with "unsubscribe" as the subject
Daryl Tester
2004-04-19 00:55:47 UTC
Permalink
Post by lloy0076
If I have a TCP connection saying "CLOSE_WAIT" as its state the manual
says that the remote end has shutdown and is waiting for the socket on
this end to close. However, at the moment I can't close the socket
because Netscape helpfully died on me.
I think the manual needs a better explanation.
Post by lloy0076
I know the local IP address, where the socket belongs and which port
number it is on. This is to say I have sufficient information to specify
exactly which socket I want to operate on. Is there any tool/command to
forcibly close a TCP/IP socket???
DAVID
[i.e. I have root access if I need it]
You're in luck. "shutdown -r now" (when run as root) clears all sockets
in the CLOSE_WAIT state, with few unexpected side-effects.

Seriously, you should only be concerned if they don't timeout and
eventually disappear (where "eventually" really means "one of the
TCP timers expires, but I can't remember which one"). (Rummages
for TCP state diagram, can't find it, utters profanity) Forget
it. Without the pretty pictures to back me up and prod my aging
memory, I will neither confirm or deny what I was about to say.
If this really troubles you, Douglas Comer and W. Richard Stevens
are your friends.


Regards,
Daryl Tester
--
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
mail linuxsa-***@linuxsa.org.au with "unsubscribe" as the subject
Loading...