Author: markt Date: Fri Aug 23 18:02:45 2013 New Revision: 1516953 URL: http://svn.apache.org/r1516953 Log: Hopefully fix some intermittent unit test failures in buildbot
Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java?rev=1516953&r1=1516952&r2=1516953&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java Fri Aug 23 18:02:45 2013 @@ -188,11 +188,14 @@ public abstract class WsRemoteEndpointIm void sendPartialString(CharBuffer part, boolean last) throws IOException { try { + // Get the timeout before we send the message. The message may + // trigger a session close and depending on timing the client + // session may close before we can read the timeout. + long timeout = getBlockingSendTimeout(); FutureToSendHandler f2sh = new FutureToSendHandler(); TextMessageSendHandler tmsh = new TextMessageSendHandler(f2sh, part, last, encoder, encoderBuffer, this); tmsh.write(); - long timeout = getBlockingSendTimeout(); if (timeout == -1) { f2sh.get(); } else { @@ -207,10 +210,13 @@ public abstract class WsRemoteEndpointIm void startMessageBlock(byte opCode, ByteBuffer payload, boolean last) throws IOException { + // Get the timeout before we send the message. The message may + // trigger a session close and depending on timing the client + // session may close before we can read the timeout. + long timeout = getBlockingSendTimeout(); FutureToSendHandler f2sh = new FutureToSendHandler(); startMessage(opCode, payload, last, f2sh); try { - long timeout = getBlockingSendTimeout(); if (timeout == -1) { f2sh.get(); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org