This error is happening sporadically, and I can't
figure out repeatable way to fix it.
When the monitor requests an exit, the TCP socket is
not always shut down (i.e. a restart where the engine
tries to bind to the monitor socket fails to work)
Discussion
Anonymous
-
2003-11-12
Logged In: YES
user_id=189676
I discovered the same problem running tests on
rcss::net::TCPSocket. The problem occurs because when a TCP
socket is closed, it is placed in a TIME_WAIT state for approx
twice as long as the data can be on the network. See man netstat
and look for TIME_WAIT.
This is to prevent a new socket from getting messages (internal
protocol or other) related to the old socket, such as close
messages.
The only solution I can think of is if the bind fails, to check the
state of the socket's port (I don't know how to do this in a
program, but netstat -t -n will give you a start) and if it's in
TIME_WAIT, then retry after a short period.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=189676
I discovered the same problem running tests on
rcss::net::TCPSocket. The problem occurs because when a TCP
socket is closed, it is placed in a TIME_WAIT state for approx
twice as long as the data can be on the network. See man netstat
and look for TIME_WAIT.
This is to prevent a new socket from getting messages (internal
protocol or other) related to the old socket, such as close
messages.
The only solution I can think of is if the bind fails, to check the
state of the socket's port (I don't know how to do this in a
program, but netstat -t -n will give you a start) and if it's in
TIME_WAIT, then retry after a short period.