[Spread-users] Socket Timeout

Ryan Caudy rcaudy at gmail.com
Sat Nov 6 17:53:02 EST 2004


Alberto, everyone else on the list who uses the Java library:

I've attached a patch for SpreadConnection.java against the 3.17
branch head, which should be the same as the 3.17.3 version.  I think
I've addressed both of Alberto's outstanding problems, but I've only
been able to test the changes that fix the connection-rejection error
codes (because of strange behavior when User tries to install a
listener).  The change to avoid the listener race condition is
untested, but simple... I simply added a call to join with the
listener thread after setting the flag to terminate it.

Alberto, please let me know if this solves both of your problems, so I
can commit the changes.

Cheers,
Ryan

On Sat, 6 Nov 2004 12:53:21 -0500, Ryan Caudy <rcaudy at gmail.com> wrote:
> Hi Again Alberto,
> 
> I looked into this problem... it appears to be caused by a race
> condition between the main thread and the listening thread.  When you
> disconnect, it instructs the listener to exit by setting a flag, and
> the listener may or may not actually exit before the disconnect method
> closes the socket.  If the listener exits first, you won't see that
> message, otherwise you will.  I'll think about a solution to avoid
> that output, but for now you shouldn't worry about it -- it's not a
> real error.  However, if you wanted to try to avoid it, use
> SpreadConnection's stopListener() method a second or so before calling
> disconnect().
> 
> Cheers,
> Ryan
> 
> On Fri, 5 Nov 2004 12:41:30 +0100 (CET), Alberto Martinez
> 
> 
> <albertinho_2000 at yahoo.es> wrote:
> > Hi!
> >    When I leave a group and disconnect from a
> > connection,   sometimes appears this message about
> > setting a timeout. Do you know some way of disabling
> > this timeout?
> >
> > LISTENER: told to exit so returning
> > socket error setting timeout java.net.SocketException:
> > Socket is closed
> >
> > ______________________________________________
> > Renovamos el Correo Yahoo!: ¡100 MB GRATIS!
> > Nuevos servicios, más seguridad
> > http://correo.yahoo.es
> >
> > _______________________________________________
> > Spread-users mailing list
> > Spread-users at lists.spread.org
> > http://lists.spread.org/mailman/listinfo/spread-users
> >
> 
> 
> --
> ---------------------------------------------------------------------
> Ryan W. Caudy
> <rcaudy at gmail.com>
> ---------------------------------------------------------------------
> Bloomberg L.P.
> <rcaudy1 at bloomberg.net>
> ---------------------------------------------------------------------
> [Alumnus]
> <caudy at cnds.jhu.edu>
> Center for Networking and Distributed Systems
> Department of Computer Science
> Johns Hopkins University
> ---------------------------------------------------------------------
> 


-- 
---------------------------------------------------------------------
Ryan W. Caudy
<rcaudy at gmail.com>
---------------------------------------------------------------------
Bloomberg L.P.
<rcaudy1 at bloomberg.net>
---------------------------------------------------------------------
[Alumnus]
<caudy at cnds.jhu.edu>         
Center for Networking and Distributed Systems
Department of Computer Science
Johns Hopkins University          
---------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SpreadConnection.java.patch
Type: application/octet-stream
Size: 1214 bytes
Desc: not available
Url : http://lists.spread.org/pipermail/spread-users/attachments/20041106/cc7460de/attachment.obj 


More information about the Spread-users mailing list