Operating System - HP-UX
1834508 Members
2603 Online
110068 Solutions
New Discussion

TCP Socket in CLOSE_WAIT status

 
Glen Strickland
New Member

TCP Socket in CLOSE_WAIT status

I have port 5101 stuck in a 'close_wait' status. Is their a quick fix to this
without rebooting the server?
3 REPLIES 3
Paul Hite_2
Frequent Advisor

Re: TCP Socket in CLOSE_WAIT status

The remote side has closed the socket and sent a FIN packet. The local kernel
has sent the ACK to the FIN packet and now, locally, the socket is in
CLOSE_WAIT. There is a program which has the socket open. If that program
tries to read from the socket, it will get a EOF. As the state indicates, the
local kernal is waiting for a close(). If you find the program that has the
socket open and kill it, that will close all open file descriptors, including
the socket in question and then the kernel will send the FIN to the remote host
and the socket will enter the LAST_ACK state. One the remote host sends that
ACK, which should happen very quickly, the socket will go poof.
Glen Strickland
New Member

Re: TCP Socket in CLOSE_WAIT status

Thanks for that info...
I know the program that is holding open the port, what I really need is a
script/commands that will kill off the port, without killing off inetd in its
entirety. Then once the port is killed off then the program should try to
re-establish the comms. port.
Any advice would be helpful...Thanks
Paul Hite_2
Frequent Advisor

Re: TCP Socket in CLOSE_WAIT status

I doubt that inetd is the program that is holding the socket in CLOSE_WAIT.
You can use the freeware program lsof to find the program that has it open.