1833875 Members
1877 Online
110063 Solutions
New Discussion

CLOSE_WAIT Question

 
SOLVED
Go to solution
Jason VanDerMark
Trusted Contributor

CLOSE_WAIT Question

I was just wondering if anyone knew whether or not you could use ndd and tcp_discon or tcp_discon_by_addr to clear ports in a CLOSE_WAIT state. Someone told me once that the clearing of ports in the CLOSE_WAIT state could not be done without a server reboot. Can anyone shed some light on this question for me? Thanks in advance.

Regards,
Jason V.
Tie two birds together, eventhough they have four wings, they cannot fly.
5 REPLIES 5
Vincenzo Restuccia
Honored Contributor

Re: CLOSE_WAIT Question

lsof-4.55
List files, sockets, etc opened by processes. Also gives a large amount of other related information.
Get http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.55/
Magdi KAMAL
Respected Contributor

Re: CLOSE_WAIT Question

Hi Jason,

I believe If you could have a look to the "TCP State transition Diagram", it would be benefic to undrestand the phenomena .

It seems that your application is not closing the connection and remaining in the CLOSE_WAIT state. You need to execute a close in order to be in the state " LAST_ACK " and this terminates correctly. I propose, you can told the developpers to finish thier works by adding the close-instruction in their code to close the socket correctly.

Please have a look in the following book :
UNIX
Network Programming
Networking APIs : Sockets and XTI
Volume 1
W. Richard Stevens.

Magdi
Craig Gilmore
Trusted Contributor

Re: CLOSE_WAIT Question

Jason,

To answer your main question without going off on other tangents: Yes, it is possible with ndd to close connections sitting in a CLOSE_WAIT state.

However, CLOSE_WAIT means that there is a program on the local system that is not responding to the file close request. BE AWARE that it is possible that you might cause that application to terminate or execute improperly.

Regards.
Jason VanDerMark
Trusted Contributor

Re: CLOSE_WAIT Question

Craig,

In this situation, the ports are being left in a CLOSE_WAIT state due to the fact that the application on the remote system, which opened the ports, terminates abrubtly. This had the side effect of leaving the ports open. Do you know the syntax for closing these ports with ndd? It would be great appreciated.

Regards,
Jason V.
Tie two birds together, eventhough they have four wings, they cannot fly.
James R. Ferguson
Acclaimed Contributor
Solution

Re: CLOSE_WAIT Question

Hi Jason:

Have a look at Knowledge Base document #S1100002433B. If you adjust the 'tcp_keepalive_interval' (with 'ndd') you should be able to automatically close the hung connections in a shorter time.

...JRF...