? SpreadConnection.java.patch Index: SpreadConnection.java =================================================================== RCS file: /storage/cvsroot/spread/javalib/SpreadConnection.java,v retrieving revision 1.10 diff -u -r1.10 SpreadConnection.java --- SpreadConnection.java 2 Dec 2004 23:58:07 -0000 1.10 +++ SpreadConnection.java 18 Aug 2005 00:00:22 -0000 @@ -833,6 +833,16 @@ throw new SpreadException("Socket(): " + e); } + // Set TCP_NODELAY, to turn off the Nagle algorithm. + //////////////////////////////////////////////////// + try { + //System.out.println( "TCP_NODELAY is: " + socket.getTcpNoDelay() ); + socket.setTcpNoDelay( true ); + //System.out.println( "TCP_NODELAY is: " + socket.getTcpNoDelay() ); + } catch( SocketException se ) { + throw new SpreadException( "Failed to set TCP_NODELAY: " + se ); + } + // Set the socket's buffer sizes. ///////////////////////////////// setBufferSizes(); @@ -1479,7 +1489,14 @@ // Wait for the thread to die, to avoid inconsistencies. //////////////////////////////////////////////////////// - listener.join(); + try { + listener.join(); + } catch( InterruptedException ie ) { + System.out.println( "Interrupted while waiting for listener to stop: " + ie ); + // Do nothing further -- The join just attempts to avoid a minor race + // condition in disconnect. The error that may result + // causes scary trace only. + } // Clear the variable. //////////////////////