@Override public void sendPartialString(String fragment, boolean isLast) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("sendPartialString({}, {})",fragment,isLast); } WebSocketFrame frame = WebSocketFrame.text(fragment).setFin(isLast); blockingWrite(frame); }
@Override public void sendPartialString(String fragment, boolean isLast) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("sendPartialString({}, {})",fragment,isLast); } WebSocketFrame frame = WebSocketFrame.text(fragment).setFin(isLast); blockingWrite(frame); }
@Override public void sendPing(ByteBuffer applicationData) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("sendPing with {}",BufferUtil.toDetailString(applicationData)); } WebSocketFrame frame = WebSocketFrame.ping().setPayload(applicationData); blockingWrite(frame); }
@Override public void sendPong(ByteBuffer applicationData) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("sendPong with {}",BufferUtil.toDetailString(applicationData)); } WebSocketFrame frame = WebSocketFrame.pong().setPayload(applicationData); blockingWrite(frame); }
@Override public void sendPing(ByteBuffer applicationData) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("sendPing with {}",BufferUtil.toDetailString(applicationData)); } WebSocketFrame frame = WebSocketFrame.ping().setPayload(applicationData); blockingWrite(frame); }
@Override public void sendPong(ByteBuffer applicationData) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("sendPong with {}",BufferUtil.toDetailString(applicationData)); } WebSocketFrame frame = WebSocketFrame.pong().setPayload(applicationData); blockingWrite(frame); }
@Override public void sendPartialBytes(ByteBuffer fragment, boolean isLast) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("sendPartialBytes({}, {})",BufferUtil.toDetailString(fragment),isLast); } WebSocketFrame frame = WebSocketFrame.binary().setPayload(fragment).setFin(isLast); blockingWrite(frame); }
@Override public void sendString(String text) throws IOException { WebSocketFrame frame = WebSocketFrame.text(text); if (LOG.isDebugEnabled()) { LOG.debug("sendString with {}",BufferUtil.toDetailString(frame.getPayload())); } blockingWrite(WebSocketFrame.text(text)); }
@Override public void sendPartialBytes(ByteBuffer fragment, boolean isLast) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("sendPartialBytes({}, {})",BufferUtil.toDetailString(fragment),isLast); } WebSocketFrame frame = WebSocketFrame.binary().setPayload(fragment).setFin(isLast); blockingWrite(frame); }
@Override public void sendString(String text) throws IOException { WebSocketFrame frame = WebSocketFrame.text(text); if (LOG.isDebugEnabled()) { LOG.debug("sendString with {}",BufferUtil.toDetailString(frame.getPayload())); } blockingWrite(WebSocketFrame.text(text)); }
/** * Blocking write of bytes. */ @Override public void sendBytes(ByteBuffer data) throws IOException { connection.getIOState().assertOutputOpen(); if (LOG.isDebugEnabled()) { LOG.debug("sendBytes with {}",BufferUtil.toDetailString(data)); } WebSocketFrame frame = WebSocketFrame.binary().setPayload(data); blockingWrite(frame); }
/** * Blocking write of bytes. */ @Override public void sendBytes(ByteBuffer data) throws IOException { connection.getIOState().assertOutputOpen(); if (LOG.isDebugEnabled()) { LOG.debug("sendBytes with {}",BufferUtil.toDetailString(data)); } WebSocketFrame frame = WebSocketFrame.binary().setPayload(data); blockingWrite(frame); }
@Override public void sendString(String text) throws IOException { lockMsg(MsgType.BLOCKING); try { WebSocketFrame frame = new TextFrame().setPayload(text); if (LOG.isDebugEnabled()) { LOG.debug("sendString with {}", BufferUtil.toDetailString(frame.getPayload())); } blockingWrite(frame); } finally { unlockMsg(MsgType.BLOCKING); } }
/** * Blocking write of bytes. */ @Override public void sendBytes(ByteBuffer data) throws IOException { lockMsg(MsgType.BLOCKING); try { connection.getIOState().assertOutputOpen(); if (LOG.isDebugEnabled()) { LOG.debug("sendBytes with {}", BufferUtil.toDetailString(data)); } blockingWrite(new BinaryFrame().setPayload(data)); } finally { unlockMsg(MsgType.BLOCKING); } }
@Override public void sendPartialString(String fragment, boolean isLast) throws IOException { boolean first = lockMsg(MsgType.PARTIAL_TEXT); try { if (LOG.isDebugEnabled()) { LOG.debug("sendPartialString({}, {})", fragment, isLast); } DataFrame frame = first ? new TextFrame() : new ContinuationFrame(); frame.setPayload(BufferUtil.toBuffer(fragment, StandardCharsets.UTF_8)); frame.setFin(isLast); blockingWrite(frame); } finally { if (isLast) unlockMsg(MsgType.PARTIAL_TEXT); } }
@Override public void sendPartialBytes(ByteBuffer fragment, boolean isLast) throws IOException { boolean first = lockMsg(MsgType.PARTIAL_BINARY); try { if (LOG.isDebugEnabled()) { LOG.debug("sendPartialBytes({}, {})", BufferUtil.toDetailString(fragment), isLast); } DataFrame frame = first ? new BinaryFrame() : new ContinuationFrame(); frame.setPayload(fragment); frame.setFin(isLast); blockingWrite(frame); } finally { if (isLast) unlockMsg(MsgType.PARTIAL_BINARY); } }