Re: dirty socket growth problem

Stuart <[email protected]> Thu, 8 Dec 2005 00:26:01 +0800
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
Eric/All,

Ok that is a fair enough point - however it still does not explain my
problem given that I have logs showing that the socket factories are not
being called.  In addition in jdk1.4 I can prevent the socket growth by
specifying a large lease value (and in jdk1.3 it does not happen):

e.g.
-Djava.rmi.dgc.leaseValue=86400000

Thanks,

Stuart



-----Original Message-----
From: Hubbard, Eric [mailto:[email protected]]
Sent: Thursday, December 08, 2005 12:06 AM
To: Stuart; [email protected]
Subject: RE: dirty socket growth problem

Eeek... double equals.  That just checks if the pointers are the same..
not the object pointed at.   I've seen this on several sockfactories
lately... some bad code snippet must be floating around the net..

Also you may consider changing this.getClass() to
this.getClass().getName() incase the two factories came from different
classloaders.



-----Original Message-----
From: Stuart [mailto:[email protected]]
Sent: Wednesday, December 07, 2005 6:57 AM
To: [email protected]
Subject: Re: dirty socket growth problem

Gregg/All,

>>One common problem with custom factories is that the equals() method
is
>>not
>>properly implemented.  Check the documentation and your implementation
to
>>make
>>sure that you are using a correct implementation so that the
underlying
>>code can
>>decide that a particular socket already exists for a path of calling.

My factory classes have the following equal and hashcode method (which
as
far as I am aware is fine):

    public int hashCode() { return 57; }
    public boolean equals(Object o) { return this.getClass() ==
o.getClass(); }

In addition I added logging to print out every time a socket is being
created.  I mentioned in my original post that my factories are not
being
called each time I see socket growth (instead the sockets grow when I
see
the lease renewed in the RMI logs).

Thanks,

Stuart

========================================================================
===
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

===========================================================================
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