* Reconnect to TCP/IP port that was previously in use
@ 2002-05-28 8:18 Rolf Huebscher
2002-05-28 14:45 ` Steve
0 siblings, 1 reply; 2+ messages in thread
From: Rolf Huebscher @ 2002-05-28 8:18 UTC (permalink / raw)
We have connections between two Unix (Compaq Tru64 4.0F) machines
using TCP/IP. The connections are always closed and reopened. However,
when trying to reopen a port that was previously in use, this will not
work for some time. This time is said to be configurable somewhere,
but we don't know where.
Anybody who knows this?
Note : the following did NOT solve the problem : "I understand you
have an application program that needs open that port
and it can�t do it because is still in use. Try to open the port with
the "SO_REUSEADDR" option for the socket. You can set this option with
the "setsockopt" call."
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Reconnect to TCP/IP port that was previously in use
2002-05-28 8:18 Reconnect to TCP/IP port that was previously in use Rolf Huebscher
@ 2002-05-28 14:45 ` Steve
0 siblings, 0 replies; 2+ messages in thread
From: Steve @ 2002-05-28 14:45 UTC (permalink / raw)
choefe@gmx.ch (Rolf Huebscher) wrote in message news:<4b9e0387.0205280018.5202837f@posting.google.com>...
> We have connections between two Unix (Compaq Tru64 4.0F) machines
> using TCP/IP. The connections are always closed and reopened. However,
> when trying to reopen a port that was previously in use, this will not
> work for some time. This time is said to be configurable somewhere,
> but we don't know where.
>
> Anybody who knows this?
>
> Note : the following did NOT solve the problem : "I understand you
> have an application program that needs open that port
> and it can�t do it because is still in use. Try to open the port with
> the "SO_REUSEADDR" option for the socket. You can set this option with
> the "setsockopt" call."
I've tried various methods to speed this up, but TCP has some rules
that it is actually never supposed to take down a socket, so there are
qute a few workarounds that are already in the code. I have found it
takes about a minute to get a socket back in my application.
Best option if you can is to nail up the socket and not open and close
it all the time. It seems to be either this or live with it. There are
some parameters in sysconfig for tcp and sockets, but I have found
them to be very ineffective at actually changing this behaviour. Some
of these are
tcp_keepalive_default = 1
tcp_keepinit = 30
tcp_keepidle = 30
tcp_keepintvl = 30
tcp_keepcnt = 2
socket
sominconn = 65535
somaxconn = 65535
I have also occasionally tried the REUSEPORT attribute, but that is a
good way to get the system to hang (quite hard as I have found out)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-05-28 14:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-28 8:18 Reconnect to TCP/IP port that was previously in use Rolf Huebscher
2002-05-28 14:45 ` Steve
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox