SUMMARY: system not releasing port

From: mark_conroy@em.fcnbd.com
Date: Thu Sep 24 1998 - 07:51:33 CDT


Thanks to all who responded.

po
ffen@San-Jose.tt.slb.com
u-
kevin@megami.veritas.com (Kevin Sheehan - Uniq) at Internet
"J
ohn P. Dodge" <john.p.dodge@boeing.com> at Internet
Um
esh Chandra Singhal <usl@ho.wipro.co.in> at Internet
Se
th Rothenberg <SROTHENB@montefiore.org> at Interne
"C
harity Gustine" <cgustine@hotmail.com> at Internet
"E
ric D. Pancer" <eric@outlook.net> at Internet

The response from Seth indicated that there is a parameter that can be set to
lower the timeout.

"Mark,
The ndd command can change driver parameters. The command we use for fast re-use
of ports is: ndd -set /dev/tcp tcp_close_wait_interval 4000

This is in 1/1000 seconds.

We have created an executable script /etc/rc3.d/S90fix_tcp_wait
That sets this value at boot.
The default is very high, eg 4 minutes.

You can see other parameters with the command: ndd /etc/tcp ?
Seth"

Similar response from Umesh:

"i,

there is this parameter in /dev/tcp which can be lowered to a few secs after a
close on that socket request has been recvd
ndd -set /dev/tcp tcp_close_wait_interval 40000 [ to 40secs] by default its
quite high.

regds
umesh"

>From Russ:

If it is a home grown program, you can add code to turn off linger and set it ro
reuse addresses. Do this before the "bind" call..

#include <sys/types.h>
#include <sys/socket.h>

struct linger linger;
int optval = 1;
linger.l_onoff = 0;
linger.l_linger = 0;
setsockopt(skt,SOL_SOCKET,SO_REUSEADDR, (char *)&optval,4)
setsockopt(skt,SOL_SOCKET,SO_LINGER, (char *)&linger,sizeof(linger));

--
Russ Poffenberger"      

From Kevin:

man setsockopt:

SO_REUSEADDR Specifies that the rules used in validating addresses supplied to bind(3XN) should allow reuse of local addresses, if this is sup- ported by the protocol. This option takes an int value.

>From John,

"Try using lsof to find the process holding the port open...

lsof -i \:1045

John P. Dodge"

Thanks again to all who took the time to help.

Mark Conroy

____________________________ Reply Separator ____________________________

bject: system not releasing port Au thor: Mark_Conroy@em.fcnbd.com at Internet Da te: 9/10/1998 3:50 PM

Qu estion for the group.

I have two sparc 1000's running solaris 2.6.

We have a home grown program that listens on port 1045 for incoming connections to a program. It runs fine on one system. We copy over the program to another sparc 1000 and start it and we receive a message that says the port is in use. I issue a netstat -a to look at all ports, and 1045 is not there.

Is there a flag that tells the kernel to release the port after the process is no longer using it?

Is there another way to tell why this port is not available?

Any help would be appreciated. I have a call in to Sun, and they are looking into it, but think I need a reboot to clear it.

Thanks in advance.

Mark Conroy



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:49 CDT