Re: intermittent connection callback exceptions

Gregg Wonderly <[email protected]> Wed, 8 Oct 2008 13:51:51 -0500
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
Peter Jones wrote:
> On Wed, Oct 01, 2008 at 04:19:49PM -0700, Mark Ackerman wrote:
>> Peter Jones wrote:
> 
>>>> Well they're not really in use, they just don't seem to be getting
>>>> released fast enough. Not sure why.
>>> In the typical life cycle of a JRMP connection, it is the client
>>> side that initiates the closing of the connection (i.e. the client
>>> side sends the first FIN), so it is on the client side that the
>>> connection remains in the TIME_WAIT state for a period, typically
>>> minutes, during which the same client address & port cannot be used
>>> to connect to the same server address & port.  Perhaps the rate of
>>> remote invocations to this endpoint is low enough that JRMP
>>> connections are not getting reused (the default idle connection
>>> timeout is 15 seconds), but high enough that they are accumulating
>>> in the TIME_WAIT state-- exhausting the limited source ports for
>>> the given destination address & port.
>> seems that setting ServerSocket.setReuseAddress(true) like Gregg
>> suggested seems to help.
> 
> Do you mean Socket.setReuseAddress(true), instead of ServerSocket?
> (For server sockets, at least Sun's JDK sets that option by default
> anyway, and I wouldn't have expected it to help this case.)

I thought that he was experiencing an "at export" time issue, sending back 
sockets bound to a specific set of port numbers, and that's why I suggested 
ServerSocket.setReuseAddress().  Interesting that something changed given what 
you state here  Peter.

Gregg Wonderly

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html