@Override public void sendPong(ByteBuffer applicationData) throws IOException, IllegalArgumentException { startMessageBlock(Constants.OPCODE_PONG, applicationData, true); }
@Override public void sendPing(ByteBuffer applicationData) throws IOException, IllegalArgumentException { startMessageBlock(Constants.OPCODE_PING, applicationData, true); }
@Override public void sendPing(ByteBuffer applicationData) throws IOException, IllegalArgumentException { startMessageBlock(Constants.OPCODE_PING, applicationData, true); }
@Override public void sendPong(ByteBuffer applicationData) throws IOException, IllegalArgumentException { startMessageBlock(Constants.OPCODE_PONG, applicationData, true); }
@Override public void flushBatch() throws IOException { startMessageBlock(Constants.INTERNAL_OPCODE_FLUSH, null, true); }
@Override public void flushBatch() throws IOException { startMessageBlock(Constants.INTERNAL_OPCODE_FLUSH, null, true); }
@Override public void flushBatch() throws IOException { startMessageBlock(Constants.INTERNAL_OPCODE_FLUSH, null, true); }
@Override public void sendPing(ByteBuffer applicationData) throws IOException, IllegalArgumentException { if (applicationData.remaining() > 125) { throw new IllegalArgumentException(sm.getString("wsRemoteEndpoint.tooMuchData")); } startMessageBlock(Constants.OPCODE_PING, applicationData, true); }
private void doWrite(boolean last) throws IOException { buffer.flip(); endpoint.startMessageBlock(Constants.OPCODE_BINARY, buffer, last); stateMachine.complete(last); buffer.clear(); } }
private void doWrite(boolean last) throws IOException { if (!Constants.STREAMS_DROP_EMPTY_MESSAGES || used) { buffer.flip(); endpoint.startMessageBlock(Constants.OPCODE_BINARY, buffer, last); } endpoint.stateMachine.complete(last); buffer.clear(); } }
@Override public void sendPong(ByteBuffer applicationData) throws IOException, IllegalArgumentException { if (applicationData.remaining() > 125) { throw new IllegalArgumentException(sm.getString("wsRemoteEndpoint.tooMuchData")); } startMessageBlock(Constants.OPCODE_PONG, applicationData, true); }
private void doWrite(boolean last) throws IOException { buffer.flip(); endpoint.startMessageBlock(Constants.OPCODE_BINARY, buffer, last); stateMachine.complete(last); buffer.clear(); } }
public void sendPartialBytes(ByteBuffer partialByte, boolean last) throws IOException { stateMachine.binaryPartialStart(); startMessageBlock(Constants.OPCODE_BINARY, partialByte, last); stateMachine.complete(last); }
public void sendBytes(ByteBuffer data) throws IOException { stateMachine.binaryStart(); startMessageBlock(Constants.OPCODE_BINARY, data, true); stateMachine.complete(true); }
public void sendPartialBytes(ByteBuffer partialByte, boolean last) throws IOException { if (partialByte == null) { throw new IllegalArgumentException(sm.getString("wsRemoteEndpoint.nullData")); } stateMachine.binaryPartialStart(); startMessageBlock(Constants.OPCODE_BINARY, partialByte, last); stateMachine.complete(last); }
public void sendBytes(ByteBuffer data) throws IOException { if (data == null) { throw new IllegalArgumentException(sm.getString("wsRemoteEndpoint.nullData")); } stateMachine.binaryStart(); startMessageBlock(Constants.OPCODE_BINARY, data, true); stateMachine.complete(true); }
public void sendBytes(ByteBuffer data) throws IOException { if (data == null) { throw MESSAGES.invalidNullData(); } stateMachine.binaryStart(); startMessageBlock(Constants.OPCODE_BINARY, data, true); stateMachine.complete(true); }
public void sendPartialBytes(ByteBuffer partialByte, boolean last) throws IOException { if (partialByte == null) { throw MESSAGES.invalidNullData(); } stateMachine.binaryPartialStart(); startMessageBlock(Constants.OPCODE_BINARY, partialByte, last); stateMachine.complete(last); }
private void sendCloseMessage(CloseReason closeReason) { // 125 is maximum size for the payload of a control message ByteBuffer msg = ByteBuffer.allocate(125); CloseCode closeCode = closeReason.getCloseCode(); // CLOSED_ABNORMALLY should not be put on the wire if (closeCode == CloseCodes.CLOSED_ABNORMALLY) { // PROTOCOL_ERROR is probably better than GOING_AWAY here msg.putShort((short) CloseCodes.PROTOCOL_ERROR.getCode()); } else { msg.putShort((short) closeCode.getCode()); } String reason = closeReason.getReasonPhrase(); if (reason != null && reason.length() > 0) { appendCloseReasonWithTruncation(msg, reason); } msg.flip(); try { wsRemoteEndpoint.startMessageBlock(Constants.OPCODE_CLOSE, msg, true); } catch (IOException ioe) { handleCloseException(ioe, closeCode); } catch (WritePendingException wpe) { handleCloseException(wpe, closeCode); } finally { webSocketContainer.unregisterSession(localEndpoint, this); } }
wsRemoteEndpoint.startMessageBlock( Constants.OPCODE_CLOSE, msg, true); } catch (IOException ioe) {