SUMMARY: How to kill sockets?

From: McCaffity, Ray (Contractor) <>
Date: Wed Dec 04 2002 - 09:42:35 EST
Got about 20 replies saying to use lsof.
I had already tried this, but as I said there was no PID
so lsof didn't help.  However I got some helpful developer
advice.  The gold stars go next to Nicolas D.  Doug W. and Mark@sol

mark@solinus mention - ing this, try adding a setsockopt() call with the
parameter of SO_REUSEADDR.
This was actually helpful, and ended up fixing the problem.

Many other people mentioned changing the stack
example: /usr/sbin/ndd -set  /dev/tcp  tcp_time_wait_interval 30000

you should be able to set the timeout on sockets via the ndd command or by
using the ndd commands within a startup script since the commands entered
using ndd via the command line are not in effect once you reboot the
system, hence the need for a startup script.

Nicolas D sent some helpful links as well.  There were related to the
solaution Mark gave above.

	You should modify tcp_time_wait_interval and also
tcp_fin_wait_2_flush_interval. Try :

ndd -set /dev/tcp tcp_time_wait_interval 40000
ndd -set /dev/tcp tcp_fin_wait_2_flush_interval 67500

Doug W. was on the right track as well.
set the socket options correctly in your app.
man -s3n setsockopt

Sahri Y. mentioned restarting inetd, which worked, but
effectively shut down the rest of the sockets on the machine
as well, so that really wasn't an option.

-----Original Message-----
From: McCaffity, Ray (Contractor) 
Sent: Tuesday, December 03, 2002 8:07 AM
To: Sunmanagers (E-mail)
Subject: How to kill sockets?

We have an application, it uses TCP/IP sockets.  However when we quit
(kill) the application, the sockets remain open (in a close wait state)
virtually forever (at least for a few days).

How can I kill these socket connections?  (The application is already dead,
there is no PID associated with the socket).  Do I have to reboot everytime
this happens?

sunmanagers mailing list
sunmanagers mailing list
Received on Wed Dec 4 09:44:48 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:59 EST