/** * Sends a complete pong message using blocking IO * Automatically frees the pooled byte buffer when done. * * @param pooledData The data to send, it will be freed when done * @param wsChannel The web socket channel */ public static void sendPongBlocking(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(pooledData, WebSocketFrameType.PONG, wsChannel); }
/** * Sends a complete ping message using blocking IO * Automatically frees the pooled byte buffer when done. * * @param pooledData The data to send, it will be freed when done * @param wsChannel The web socket channel */ public static void sendPingBlocking(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(pooledData, WebSocketFrameType.PING, wsChannel); }
/** * Sends a complete text message, invoking the callback when complete * Automatically frees the pooled byte buffer when done. * * @param pooledData The data to send, it will be freed when done * @param wsChannel The web socket channel */ public static void sendTextBlocking(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(pooledData, WebSocketFrameType.TEXT, wsChannel); }
/** * Sends a complete text message, invoking the callback when complete * * @param message The text to send * @param wsChannel The web socket channel */ public static void sendTextBlocking(final ByteBuffer message, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(message, WebSocketFrameType.TEXT, wsChannel); }
/** * Sends a complete ping message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendPingBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(data, WebSocketFrameType.PING, wsChannel); }
/** * Sends a complete pong message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendPongBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(data, WebSocketFrameType.PONG, wsChannel); }
/** * Sends a complete binary message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendBinaryBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(data, WebSocketFrameType.BINARY, wsChannel); }
/** * Sends a complete binary message using blocking IO * Automatically frees the pooled byte buffer when done. * * @param pooledData The data to send, it will be freed when done * @param wsChannel The web socket channel */ public static void sendBinaryBlocking(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(pooledData, WebSocketFrameType.BINARY, wsChannel); }
/** * Sends a complete text message, invoking the callback when complete * * @param message The text to send * @param wsChannel The web socket channel */ public static void sendTextBlocking(final String message, final WebSocketChannel wsChannel) throws IOException { final ByteBuffer data = ByteBuffer.wrap(message.getBytes(StandardCharsets.UTF_8)); sendBlockingInternal(data, WebSocketFrameType.TEXT, wsChannel); }
/** * Sends a complete binary message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendBinaryBlocking(final ByteBuffer[] data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(mergeBuffers(data), WebSocketFrameType.BINARY, wsChannel); }
/** * Sends a complete ping message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendPingBlocking(final ByteBuffer[] data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(mergeBuffers(data), WebSocketFrameType.PING, wsChannel); }
/** * Sends a complete pong message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendPongBlocking(final ByteBuffer[] data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(mergeBuffers(data), WebSocketFrameType.PONG, wsChannel); }
private static void sendBlockingInternal(final ByteBuffer data, WebSocketFrameType type, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(new ImmediatePooledByteBuffer(data), type, wsChannel); }
/** * Sends a complete close message, invoking the callback when complete * * @param closeMessage the close message * @param wsChannel The web socket channel */ public static void sendCloseBlocking(final CloseMessage closeMessage, final WebSocketChannel wsChannel) throws IOException { wsChannel.setCloseReason(closeMessage.getReason()); wsChannel.setCloseCode(closeMessage.getCode()); sendBlockingInternal(closeMessage.toByteBuffer(), WebSocketFrameType.CLOSE, wsChannel); } /**
/** * Sends a complete binary message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendBinaryBlocking(final ByteBuffer data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(data, WebSocketFrameType.BINARY, wsChannel); }
/** * Sends a complete text message, invoking the callback when complete * * @param message The text to send * @param wsChannel The web socket channel */ public static void sendTextBlocking(final ByteBuffer message, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(message, WebSocketFrameType.TEXT, wsChannel); }
/** * Sends a complete ping message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendPingBlocking(final ByteBuffer[] data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(mergeBuffers(data), WebSocketFrameType.PING, wsChannel); }
/** * Sends a complete pong message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendPongBlocking(final ByteBuffer[] data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(mergeBuffers(data), WebSocketFrameType.PONG, wsChannel); }
/** * Sends a complete binary message using blocking IO * * @param data The data to send * @param wsChannel The web socket channel */ public static void sendBinaryBlocking(final ByteBuffer[] data, final WebSocketChannel wsChannel) throws IOException { sendBlockingInternal(mergeBuffers(data), WebSocketFrameType.BINARY, wsChannel); }
/** * Sends a complete close message, invoking the callback when complete * * @param closeMessage the close message * @param wsChannel The web socket channel */ public static void sendCloseBlocking(final CloseMessage closeMessage, final WebSocketChannel wsChannel) throws IOException { wsChannel.setCloseReason(closeMessage.getReason()); wsChannel.setCloseCode(closeMessage.getCode()); sendBlockingInternal(closeMessage.toByteBuffer(), WebSocketFrameType.CLOSE, wsChannel); } /**