Package io.undertow.websockets.core
Class WebSockets
- java.lang.Object
-
- io.undertow.websockets.core.WebSockets
-
public class WebSockets extends java.lang.Object
- Author:
- Stuart Douglas
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.nio.ByteBuffer
mergeBuffers(java.nio.ByteBuffer... payload)
static void
sendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static void
sendBinary(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete binary message, invoking the callback when complete Automatically frees the pooled byte buffer when done.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.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.static void
sendBinary(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete binary message, invoking the callback when completestatic void
sendBinary(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete binary message, invoking the callback when completestatic <T> void
sendBinary(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete binary message, invoking the callback when completestatic <T> void
sendBinary(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete binary message, invoking the callback when completestatic void
sendBinary(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete binary message, invoking the callback when completestatic void
sendBinary(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete binary message, invoking the callback when completestatic <T> void
sendBinary(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete binary message, invoking the callback when completestatic <T> void
sendBinary(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete binary message, invoking the callback when completestatic void
sendBinaryBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel)
Sends a complete binary message using blocking IO Automatically frees the pooled byte buffer when done.static void
sendBinaryBlocking(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel)
Sends a complete binary message using blocking IOstatic void
sendBinaryBlocking(java.nio.ByteBuffer data, WebSocketChannel wsChannel)
Sends a complete binary message using blocking IOstatic void
sendClose(int code, java.lang.String reason, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete close message, invoking the callback when completestatic <T> void
sendClose(int code, java.lang.String reason, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete close message, invoking the callback when completestatic void
sendClose(CloseMessage closeMessage, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete close message, invoking the callback when completestatic <T> void
sendClose(CloseMessage closeMessage, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete close message, invoking the callback when completestatic void
sendClose(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete close message, invoking the callback when completestatic <T> void
sendClose(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete close message, invoking the callback when completestatic void
sendClose(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete close message, invoking the callback when completestatic <T> void
sendClose(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete close message, invoking the callback when completestatic void
sendCloseBlocking(int code, java.lang.String reason, WebSocketChannel wsChannel)
Sends a complete close message, invoking the callback when completestatic void
sendCloseBlocking(CloseMessage closeMessage, WebSocketChannel wsChannel)
Sends a complete close message, invoking the callback when completestatic void
sendCloseBlocking(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel)
Sends a complete close message, invoking the callback when completestatic void
sendCloseBlocking(java.nio.ByteBuffer data, WebSocketChannel wsChannel)
Sends a complete close message, invoking the callback when completestatic void
sendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static void
sendPing(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete ping message, invoking the callback when complete Automatically frees the pooled byte buffer when done.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.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.static void
sendPing(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete ping message, invoking the callback when completestatic void
sendPing(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete ping message, invoking the callback when completestatic <T> void
sendPing(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete ping message, invoking the callback when completestatic <T> void
sendPing(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete ping message, invoking the callback when completestatic void
sendPing(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete ping message, invoking the callback when completestatic void
sendPing(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete ping message, invoking the callback when completestatic <T> void
sendPing(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete ping message, invoking the callback when completestatic <T> void
sendPing(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete ping message, invoking the callback when completestatic void
sendPingBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel)
Sends a complete ping message using blocking IO Automatically frees the pooled byte buffer when done.static void
sendPingBlocking(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel)
Sends a complete ping message using blocking IOstatic void
sendPingBlocking(java.nio.ByteBuffer data, WebSocketChannel wsChannel)
Sends a complete ping message using blocking IOstatic void
sendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static void
sendPong(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete pong message, invoking the callback when complete Automatically frees the pooled byte buffer when done.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.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.static void
sendPong(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete pong message, invoking the callback when completestatic void
sendPong(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete pong message, invoking the callback when completestatic <T> void
sendPong(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete pong message, invoking the callback when completestatic <T> void
sendPong(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete pong message, invoking the callback when completestatic void
sendPong(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete pong message, invoking the callback when completestatic void
sendPong(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete pong message, invoking the callback when completestatic <T> void
sendPong(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete pong message, invoking the callback when completestatic <T> void
sendPong(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete pong message, invoking the callback when completestatic void
sendPongBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel)
Sends a complete pong message using blocking IO Automatically frees the pooled byte buffer when done.static void
sendPongBlocking(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel)
Sends a complete pong message using blocking IOstatic void
sendPongBlocking(java.nio.ByteBuffer data, WebSocketChannel wsChannel)
Sends a complete pong message using blocking IOstatic void
sendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static void
sendText(PooledByteBuffer pooledData, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.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.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.static void
sendText(java.lang.String message, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete text message, invoking the callback when completestatic void
sendText(java.lang.String message, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete text message, invoking the callback when completestatic <T> void
sendText(java.lang.String message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete text message, invoking the callback when completestatic <T> void
sendText(java.lang.String message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete text message, invoking the callback when completestatic void
sendText(java.nio.ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback)
Sends a complete text message, invoking the callback when completestatic void
sendText(java.nio.ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<java.lang.Void> callback, long timeoutmillis)
Sends a complete text message, invoking the callback when completestatic <T> void
sendText(java.nio.ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context)
Sends a complete text message, invoking the callback when completestatic <T> void
sendText(java.nio.ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<T> callback, T context, long timeoutmillis)
Sends a complete text message, invoking the callback when completestatic void
sendTextBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel)
Sends a complete text message, invoking the callback when complete Automatically frees the pooled byte buffer when done.static void
sendTextBlocking(java.lang.String message, WebSocketChannel wsChannel)
Sends a complete text message, invoking the callback when completestatic void
sendTextBlocking(java.nio.ByteBuffer message, WebSocketChannel wsChannel)
Sends a complete text message, invoking the callback when complete
-
-
-
Method Detail
-
sendText
public static void sendText(java.lang.String message, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.lang.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(java.lang.String message, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.lang.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(java.nio.ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer message, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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<java.lang.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<java.lang.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(java.lang.String message, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete text message, invoking the callback when complete- Parameters:
message
- The text to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendTextBlocking
public static void sendTextBlocking(java.nio.ByteBuffer message, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete text message, invoking the callback when complete- Parameters:
message
- The text to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendTextBlocking
public static void sendTextBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel) throws java.io.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:
java.io.IOException
-
sendPing
public static void sendPing(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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<java.lang.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<java.lang.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(java.nio.ByteBuffer data, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete ping message using blocking IO- Parameters:
data
- The data to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendPingBlocking
public static void sendPingBlocking(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete ping message using blocking IO- Parameters:
data
- The data to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendPingBlocking
public static void sendPingBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel) throws java.io.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:
java.io.IOException
-
sendPong
public static void sendPong(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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<java.lang.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<java.lang.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(java.nio.ByteBuffer data, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete pong message using blocking IO- Parameters:
data
- The data to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendPongBlocking
public static void sendPongBlocking(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete pong message using blocking IO- Parameters:
data
- The data to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendPongBlocking
public static void sendPongBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel) throws java.io.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:
java.io.IOException
-
sendBinary
public static void sendBinary(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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<java.lang.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<java.lang.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(java.nio.ByteBuffer data, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete binary message using blocking IO- Parameters:
data
- The data to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendBinaryBlocking
public static void sendBinaryBlocking(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete binary message using blocking IO- Parameters:
data
- The data to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendBinaryBlocking
public static void sendBinaryBlocking(PooledByteBuffer pooledData, WebSocketChannel wsChannel) throws java.io.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:
java.io.IOException
-
sendClose
public static void sendClose(java.nio.ByteBuffer data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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(java.nio.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, java.lang.String reason, WebSocketChannel wsChannel, WebSocketCallback<java.lang.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, java.lang.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<java.lang.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 java.io.IOException
Sends a complete close message, invoking the callback when complete- Parameters:
closeMessage
- the close messagewsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendCloseBlocking
public static void sendCloseBlocking(int code, java.lang.String reason, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete close message, invoking the callback when complete- Parameters:
code
-wsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendCloseBlocking
public static void sendCloseBlocking(java.nio.ByteBuffer data, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete close message, invoking the callback when complete- Parameters:
data
- The data to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
sendCloseBlocking
public static void sendCloseBlocking(java.nio.ByteBuffer[] data, WebSocketChannel wsChannel) throws java.io.IOException
Sends a complete close message, invoking the callback when complete- Parameters:
data
- The data to sendwsChannel
- The web socket channel- Throws:
java.io.IOException
-
mergeBuffers
public static java.nio.ByteBuffer mergeBuffers(java.nio.ByteBuffer... payload)
-
-