logo       

Re: cannot re-connect: msg#00006

network.spread.user

Subject: Re: cannot re-connect

On 12/1/06, Jonathan Stanton <jonathan@xxxxxxxxxxxx> wrote:
This is a known limitation of TCP connections, if the server socket is
closed before the clients, the server socket enters a wait state for a
few minutes. During this time the server can not reuse the same port
number.

If you look in the sample spread.conf file, there is a documented option
called SocketPortReuse that can address this.

Aaah ...perfect that's what I was missing :)

However, you can set it to always reuse the port number by changing the
value to "ON". The reason we don't do this by default is that it is a
security risk because other processes on the same machine as the Spread
daemon can also bind to the same address/port as Spread then and capture
the Spread traffic or interfere with it (depending on OS/version)

Sure

If you set it to ON you will not have a problem with restarting the
spread daemon.

OK ...working now :)

I understand your idea for a SpreadConnection.isConnected(), in many
cases I didn't think it was needed as whenever you try to use the
connection, if it was broken you will get an immediate error and can
recover from it by reconnecting. Is there some other scenario where it
would be useful?

Well, the question is - when do I know I have to re-establish the
connection to spread?

IMO there is no obvious way to find out. Just getting a
SpreadConnection when trying to send a message is a bit of a weak
contract. Who knows what else could be the possible cause of the
exception ...as it is a pretty generic exception. So I thought I could
check whether the connection is still intact once I get an exception -
but there is no such thing to check.

See the problem? Any idea?

cheers
--
Torsten


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise