Package io.undertow.websockets.core
Class WebSockets
- java.lang.Object
-
- io.undertow.websockets.core.WebSockets
-
public class WebSockets extends Object
- Author:
- Stuart Douglas
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ByteBuffermergeBuffers(ByteBuffer... payload)static voidsendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static voidsendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static <T> voidsendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static <T> voidsendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static voidsendBinary(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete binary message, invoking the callback when completestatic voidsendBinary(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete binary message, invoking the callback when completestatic <T> voidsendBinary(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete binary message, invoking the callback when completestatic <T> voidsendBinary(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete binary message, invoking the callback when completestatic voidsendBinary(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete binary message, invoking the callback when completestatic voidsendBinary(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete binary message, invoking the callback when completestatic <T> voidsendBinary(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete binary message, invoking the callback when completestatic <T> voidsendBinary(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete binary message, invoking the callback when completestatic voidsendBinaryBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel)Sends a complete binary message using blocking IO Automatically frees the pooled byte buffer when done.static voidsendBinaryBlocking(ByteBuffer[] data, WebSocketChannel wsChannel)Sends a complete binary message using blocking IOstatic voidsendBinaryBlocking(ByteBuffer data, WebSocketChannel wsChannel)Sends a complete binary message using blocking IOstatic voidsendClose(int code, String reason, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete close message, invoking the callback when completestatic <T> voidsendClose(int code, String reason, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete close message, invoking the callback when completestatic voidsendClose(CloseMessage closeMessage, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete close message, invoking the callback when completestatic <T> voidsendClose(CloseMessage closeMessage, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete close message, invoking the callback when completestatic voidsendClose(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete close message, invoking the callback when completestatic <T> voidsendClose(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete close message, invoking the callback when completestatic voidsendClose(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete close message, invoking the callback when completestatic <T> voidsendClose(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete close message, invoking the callback when completestatic voidsendCloseBlocking(int code, String reason, WebSocketChannel wsChannel)Sends a complete close message, invoking the callback when completestatic voidsendCloseBlocking(CloseMessage closeMessage, WebSocketChannel wsChannel)Sends a complete close message, invoking the callback when completestatic voidsendCloseBlocking(ByteBuffer[] data, WebSocketChannel wsChannel)Sends a complete close message, invoking the callback when completestatic voidsendCloseBlocking(ByteBuffer data, WebSocketChannel wsChannel)Sends a complete close message, invoking the callback when completestatic voidsendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static voidsendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static <T> voidsendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static <T> voidsendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static voidsendPing(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete ping message, invoking the callback when completestatic voidsendPing(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete ping message, invoking the callback when completestatic <T> voidsendPing(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete ping message, invoking the callback when completestatic <T> voidsendPing(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete ping message, invoking the callback when completestatic voidsendPing(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete ping message, invoking the callback when completestatic voidsendPing(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete ping message, invoking the callback when completestatic <T> voidsendPing(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete ping message, invoking the callback when completestatic <T> voidsendPing(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete ping message, invoking the callback when completestatic voidsendPingBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel)Sends a complete ping message using blocking IO Automatically frees the pooled byte buffer when done.static voidsendPingBlocking(ByteBuffer[] data, WebSocketChannel wsChannel)Sends a complete ping message using blocking IOstatic voidsendPingBlocking(ByteBuffer data, WebSocketChannel wsChannel)Sends a complete ping message using blocking IOstatic voidsendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static voidsendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static <T> voidsendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static <T> voidsendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static voidsendPong(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete pong message, invoking the callback when completestatic voidsendPong(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete pong message, invoking the callback when completestatic <T> voidsendPong(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete pong message, invoking the callback when completestatic <T> voidsendPong(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete pong message, invoking the callback when completestatic voidsendPong(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete pong message, invoking the callback when completestatic voidsendPong(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete pong message, invoking the callback when completestatic <T> voidsendPong(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete pong message, invoking the callback when completestatic <T> voidsendPong(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete pong message, invoking the callback when completestatic voidsendPongBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel)Sends a complete pong message using blocking IO Automatically frees the pooled byte buffer when done.static voidsendPongBlocking(ByteBuffer[] data, WebSocketChannel wsChannel)Sends a complete pong message using blocking IOstatic voidsendPongBlocking(ByteBuffer data, WebSocketChannel wsChannel)Sends a complete pong message using blocking IOstatic voidsendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static voidsendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static <T> voidsendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static <T> voidsendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static voidsendText(String message, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete text message, invoking the callback when completestatic voidsendText(String message, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete text message, invoking the callback when completestatic <T> voidsendText(String message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete text message, invoking the callback when completestatic <T> voidsendText(String message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete text message, invoking the callback when completestatic voidsendText(ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete text message, invoking the callback when completestatic voidsendText(ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)Sends a complete text message, invoking the callback when completestatic <T> voidsendText(ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete text message, invoking the callback when completestatic <T> voidsendText(ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)Sends a complete text message, invoking the callback when completestatic voidsendTextBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel)Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static voidsendTextBlocking(String message, WebSocketChannel wsChannel)Sends a complete text message, invoking the callback when completestatic voidsendTextBlocking(ByteBuffer message, WebSocketChannel wsChannel)Sends a complete text message, invoking the callback when complete
-
-
-
Method Detail
-
sendText
public static void sendText(String message, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendText
public static <T> void sendText(String message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendText
public static void sendText(String message, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendText
public static <T> void sendText(String message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendText
public static void sendText(ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendText
public static <T> void sendText(ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendText
public static void sendText(ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendText
public static <T> void sendText(ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendText
public static void sendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendText
public static <T> void sendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendText
public static void sendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendText
public static <T> void sendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendTextBlocking
public static void sendTextBlocking(String message, WebSocketChannel wsChannel) throws IOException
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channel- Throws:
IOException
-
sendTextBlocking
public static void sendTextBlocking(ByteBuffer message, WebSocketChannel wsChannel) throws IOException
Sends a complete text message, invoking the callback when complete- Parameters:
message- The text to sendwsChannel- The web socket channel- Throws:
IOException
-
sendTextBlocking
public static void sendTextBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel) throws IOException
Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channel- Throws:
IOException
-
sendPing
public static void sendPing(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete ping message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendPing
public static <T> void sendPing(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete ping message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendPing
public static void sendPing(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete ping message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendPing
public static <T> void sendPing(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete ping message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendPing
public static void sendPing(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete ping message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendPing
public static <T> void sendPing(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete ping message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendPing
public static void sendPing(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete ping message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendPing
public static <T> void sendPing(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete ping message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendPing
public static void sendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendPing
public static <T> void sendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendPing
public static void sendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendPing
public static <T> void sendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendPingBlocking
public static void sendPingBlocking(ByteBuffer data, WebSocketChannel wsChannel) throws IOException
Sends a complete ping message using blocking IO- Parameters:
data- The data to sendwsChannel- The web socket channel- Throws:
IOException
-
sendPingBlocking
public static void sendPingBlocking(ByteBuffer[] data, WebSocketChannel wsChannel) throws IOException
Sends a complete ping message using blocking IO- Parameters:
data- The data to sendwsChannel- The web socket channel- Throws:
IOException
-
sendPingBlocking
public static void sendPingBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel) throws IOException
Sends a complete ping message using blocking IO Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channel- Throws:
IOException
-
sendPong
public static void sendPong(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete pong message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendPong
public static <T> void sendPong(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete pong message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendPong
public static void sendPong(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete pong message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendPong
public static <T> void sendPong(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete pong message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendPong
public static void sendPong(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete pong message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendPong
public static <T> void sendPong(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete pong message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendPong
public static void sendPong(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete pong message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendPong
public static <T> void sendPong(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete pong message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendPong
public static void sendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendPong
public static <T> void sendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendPong
public static void sendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendPong
public static <T> void sendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendPongBlocking
public static void sendPongBlocking(ByteBuffer data, WebSocketChannel wsChannel) throws IOException
Sends a complete pong message using blocking IO- Parameters:
data- The data to sendwsChannel- The web socket channel- Throws:
IOException
-
sendPongBlocking
public static void sendPongBlocking(ByteBuffer[] data, WebSocketChannel wsChannel) throws IOException
Sends a complete pong message using blocking IO- Parameters:
data- The data to sendwsChannel- The web socket channel- Throws:
IOException
-
sendPongBlocking
public static void sendPongBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel) throws IOException
Sends a complete pong message using blocking IO Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channel- Throws:
IOException
-
sendBinary
public static void sendBinary(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete binary message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendBinary
public static <T> void sendBinary(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete binary message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendBinary
public static void sendBinary(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete binary message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendBinary
public static <T> void sendBinary(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete binary message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendBinary
public static void sendBinary(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete binary message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendBinary
public static <T> void sendBinary(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete binary message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendBinary
public static void sendBinary(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete binary message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendBinary
public static <T> void sendBinary(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete binary message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendBinary
public static void sendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendBinary
public static <T> void sendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendBinary
public static void sendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<Void> callback, long timeoutmillis)
Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completiontimeoutmillis- the timeout in milliseconds
-
sendBinary
public static <T> void sendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completiontimeoutmillis- the timeout in milliseconds
-
sendBinaryBlocking
public static void sendBinaryBlocking(ByteBuffer data, WebSocketChannel wsChannel) throws IOException
Sends a complete binary message using blocking IO- Parameters:
data- The data to sendwsChannel- The web socket channel- Throws:
IOException
-
sendBinaryBlocking
public static void sendBinaryBlocking(ByteBuffer[] data, WebSocketChannel wsChannel) throws IOException
Sends a complete binary message using blocking IO- Parameters:
data- The data to sendwsChannel- The web socket channel- Throws:
IOException
-
sendBinaryBlocking
public static void sendBinaryBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel) throws IOException
Sends a complete binary message using blocking IO Automatically frees the pooled byte buffer when done.- Parameters:
pooledData- The data to send, it will be freed when donewsChannel- The web socket channel- Throws:
IOException
-
sendClose
public static void sendClose(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete close message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendClose
public static <T> void sendClose(ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete close message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendClose
public static void sendClose(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete close message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendClose
public static <T> void sendClose(ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete close message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendClose
public static void sendClose(int code, String reason, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)Sends a complete close message, invoking the callback when complete- Parameters:
code- The close codewsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendClose
public static <T> void sendClose(int code, String reason, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)Sends a complete close message, invoking the callback when complete- Parameters:
code- The close codewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendClose
public static void sendClose(CloseMessage closeMessage, WebSocketChannel wsChannel, WebSocketCallback<Void> callback)
Sends a complete close message, invoking the callback when complete- Parameters:
closeMessage- The close messagewsChannel- The web socket channelcallback- The callback to invoke on completion
-
sendClose
public static <T> void sendClose(CloseMessage closeMessage, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete close message, invoking the callback when complete- Parameters:
closeMessage- The close messagewsChannel- The web socket channelcallback- The callback to invoke on completioncontext- The context object that will be passed to the callback on completion
-
sendCloseBlocking
public static void sendCloseBlocking(CloseMessage closeMessage, WebSocketChannel wsChannel) throws IOException
Sends a complete close message, invoking the callback when complete- Parameters:
closeMessage- the close messagewsChannel- The web socket channel- Throws:
IOException
-
sendCloseBlocking
public static void sendCloseBlocking(int code, String reason, WebSocketChannel wsChannel) throws IOExceptionSends a complete close message, invoking the callback when complete- Parameters:
code-wsChannel- The web socket channel- Throws:
IOException
-
sendCloseBlocking
public static void sendCloseBlocking(ByteBuffer data, WebSocketChannel wsChannel) throws IOException
Sends a complete close message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channel- Throws:
IOException
-
sendCloseBlocking
public static void sendCloseBlocking(ByteBuffer[] data, WebSocketChannel wsChannel) throws IOException
Sends a complete close message, invoking the callback when complete- Parameters:
data- The data to sendwsChannel- The web socket channel- Throws:
IOException
-
mergeBuffers
public static ByteBuffer mergeBuffers(ByteBuffer... payload)
-
-