@Override public final void setBatchingAllowed(boolean batchingAllowed) throws IOException { base.setBatchingAllowed(batchingAllowed); }
@Override public final void setBatchingAllowed(boolean batchingAllowed) throws IOException { base.setBatchingAllowed(batchingAllowed); }
@Override public final void setBatchingAllowed(boolean batchingAllowed) throws IOException { base.setBatchingAllowed(batchingAllowed); }
@Override public final void setBatchingAllowed(boolean batchingAllowed) throws IOException { base.setBatchingAllowed(batchingAllowed); }
@Override public final void setBatchingAllowed(boolean batchingAllowed) throws IOException { base.setBatchingAllowed(batchingAllowed); }
void startMessage(byte opCode, ByteBuffer payload, boolean last, SendHandler handler) { wsSession.updateLastActive(); MessagePart mp = new MessagePart(opCode, payload, last, handler, this); synchronized (messagePartLock) { if (Constants.OPCODE_CLOSE == mp.getOpCode()) { try { setBatchingAllowed(false); } catch (IOException e) { log.warn(sm.getString( "wsRemoteEndpoint.flushOnCloseFailed"), e); } } if (messagePartInProgress) { // When a control message is sent while another message is being // the control message is queued. Chances are the subsequent // data message part will end up queued while the control // message is sent. The logic in this class (state machine, // EndMessageHanlder, TextMessageSendHandler) ensures that there // will only ever be one data message part in the queue. There // could be multiple control messages in the queue. // Add it to the queue messagePartQueue.add(mp); } else { messagePartInProgress = true; writeMessagePart(mp); } } }
wsRemoteEndpoint.setBatchingAllowed(false); } catch (IOException e) { WebsocketsLogger.ROOT_LOGGER.flushOnCloseFailed(e);
/** * Called when a close message is received. Should only ever happen once. * Also called after a protocol error when the ProtocolHandler needs to * force the closing of the connection. */ public void onClose(CloseReason closeReason) { synchronized (stateLock) { if (state != State.CLOSED) { try { wsRemoteEndpoint.setBatchingAllowed(false); } catch (IOException e) { log.warn(sm.getString("wsSession.flushFailOnClose"), e); fireEndpointOnError(e); } if (state == State.OPEN) { state = State.OUTPUT_CLOSED; sendCloseMessage(closeReason); fireEndpointOnClose(closeReason); } state = State.CLOSED; // Close the socket wsRemoteEndpoint.close(); } } }
wsRemoteEndpoint.setBatchingAllowed(false); } catch (IOException e) { log.warn(sm.getString("wsSession.flushFailOnClose"), e);
/** * Called when a close message is received. Should only ever happen once. * Also called after a protocol error when the ProtocolHandler needs to * force the closing of the connection. * * @param closeReason The reason contained within the received close * message. */ public void onClose(CloseReason closeReason) { synchronized (stateLock) { if (state != State.CLOSED) { try { wsRemoteEndpoint.setBatchingAllowed(false); } catch (IOException e) { log.warn(sm.getString("wsSession.flushFailOnClose"), e); fireEndpointOnError(e); } if (state == State.OPEN) { state = State.OUTPUT_CLOSED; sendCloseMessage(closeReason); fireEndpointOnClose(closeReason); } state = State.CLOSED; // Close the socket wsRemoteEndpoint.close(); } } }
/** * Called when a close message is received. Should only ever happen once. * Also called after a protocol error when the ProtocolHandler needs to * force the closing of the connection. * * @param closeReason The reason contained within the received close * message. */ public void onClose(CloseReason closeReason) { synchronized (stateLock) { if (state != State.CLOSED) { try { wsRemoteEndpoint.setBatchingAllowed(false); } catch (IOException e) { log.warn(sm.getString("wsSession.flushFailOnClose"), e); fireEndpointOnError(e); } if (state == State.OPEN) { state = State.OUTPUT_CLOSED; sendCloseMessage(closeReason); fireEndpointOnClose(closeReason); } state = State.CLOSED; // Close the socket wsRemoteEndpoint.close(); } } }
wsRemoteEndpoint.setBatchingAllowed(false); } catch (IOException e) { log.warn(sm.getString("wsSession.flushFailOnClose"), e);
wsRemoteEndpoint.setBatchingAllowed(false); } catch (IOException e) { log.warn(sm.getString("wsSession.flushFailOnClose"), e);
/** * Called when a close message is received. Should only ever happen once. * Also called after a protocol error when the ProtocolHandler needs to * force the closing of the connection. */ public void onClose(CloseReason closeReason) { synchronized (stateLock) { if (state == State.OPEN) { try { wsRemoteEndpoint.setBatchingAllowed(false); } catch (IOException e) { WebsocketsLogger.ROOT_LOGGER.flushOnCloseFailed(e); fireEndpointOnError(e); } if (!Constants.RELAXED_CLOSE_EVENT) { sendCloseMessage(closeReason); fireEndpointOnClose(closeReason); } else { fireEndpointOnClose(closeReason); sendCloseMessage(closeReason); } state = State.CLOSED; } // Close the socket wsRemoteEndpoint.close(); } }