SUMMARY: Clearing a Port

From: Jonathan Williams (jonathw@shubertorg.com)
Date: Thu Oct 17 2002 - 12:37:09 EDT


Well, the big thanks go to Martin Adolfsson with the following reply:

>Unfortunately I don't know of any useful command for this, but if the
>server is an application that is developed by your company/one that you
>have the sourcecode for, you might want to ask one of your programmers
>to make sure that SO_REUSEADDR is used in the call to bind() (See
>section 4.5 of
>ftp://rtfm.mit.edu/pub/usenet/news.answers/unix-faq/socket) since there
>is a possiblity that will help.

So I passed that little tidbit off to a programmer, and an hour later he emailed
me saying that he has a fix for the problem, and that the SO_REUSEADDR did it.
So thank you very much. I also received a bunch of emails that looked very much
like this:

>There are a few parameters that may help you in the "inet" subsystem of
sysconfigtab, they are
>
>tcp_keepalive_default
>tcp_keepcnt
>tcp_keepidle
>tcp_keepintvl
>
>Normally, in good network programming practice, a socket connection when
properly set up will >enable the keepalive timer and in the event of a broken
connection will clean itself up. >Unfortunately not all applications are written
like this so we have the tcp_keepalive_default. >Enabling this parameter (set it
to 1) will enable "keepalive" on all sockets created on the system, >this will
have the effect that you desire; to clean up broken connections. The default
setting of >tcp_keepalive_default is 0 (turned off). Once this is turned on then
sockets will be checked after >"keepidle" time and then will be checked for
"keepcnt" times; each time seperated by the >"keepintvl". If at the end of all
of this there is no socket communications the socket connection will >be cleaned
away. Once you set "keepalive" the defaults for the other parameters will not
clear a >socket connection for about 2 hours and ten minutes (if I remember
right) so you may want to >adjust the keepidle time to something more reasonable
(default 2 hours or 14400 half seconds).
>For more info check the man page for sys_attrs_inet.

Oh, and this is a good one too:
>I had a similar situation with an app on disconnect. There are a couple of
>parameters you can adjust in sysconfigtab. One is "tcp_keepidle". It's
>default is 1500 ticks and It was recommended by HPQ to adjust to 600. The
>other was "tcp_keepalive". These, I believe, are documented in the system
>configuration and tuning guide but I'm not at the office so I'm not sure.
>
>After these adjustments to the "inet:" stanza in sysconfigtab (use
>sysconfigdb to make the changes), our problem went away.

I would like to thank the following for there replies:
Blake Roberts, Rodney S, Steve VanDevender, Robert Mulley, Gary Luo, Pat
Barrowclough, Benjamin Smith, Dennis Sylvester, and Robert Collins.

Jonathan Williams
Unix Systems Administrator
The Shubert Organization, Inc.



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:48:56 EDT