public interface WebSocket
| Modifier and Type | Method and Description |
|---|---|
WebSocket |
addWebSocketListener(WebSocketListener l)
Add a
WebSocketListener |
SocketAddress |
getLocalAddress()
Get local address client initiated request from.
|
SocketAddress |
getRemoteAddress()
Get remote address client initiated request to.
|
io.netty.handler.codec.http.HttpHeaders |
getUpgradeHeaders() |
boolean |
isOpen() |
WebSocket |
removeWebSocketListener(WebSocketListener l)
Remove a
WebSocketListener |
io.netty.util.concurrent.Future<Void> |
sendBinaryFrame(byte[] payload)
Send a full binary frame.
|
io.netty.util.concurrent.Future<Void> |
sendBinaryFrame(byte[] payload,
boolean finalFragment,
int rsv)
Allows sending a binary frame with fragmentation or extension bits.
|
io.netty.util.concurrent.Future<Void> |
sendBinaryFrame(io.netty.buffer.ByteBuf payload,
boolean finalFragment,
int rsv)
Allows sending a binary frame with fragmentation or extension bits.
|
io.netty.util.concurrent.Future<Void> |
sendCloseFrame()
Send a empty close frame.
|
io.netty.util.concurrent.Future<Void> |
sendCloseFrame(int statusCode,
String reasonText)
Send a empty close frame.
|
io.netty.util.concurrent.Future<Void> |
sendContinuationFrame(byte[] payload,
boolean finalFragment,
int rsv)
Send a binary continuation frame.
|
io.netty.util.concurrent.Future<Void> |
sendContinuationFrame(io.netty.buffer.ByteBuf payload,
boolean finalFragment,
int rsv)
Send a continuation frame (those are actually untyped as counterpart must have memorized first fragmented frame type).
|
io.netty.util.concurrent.Future<Void> |
sendContinuationFrame(String payload,
boolean finalFragment,
int rsv)
Send a text continuation frame.
|
io.netty.util.concurrent.Future<Void> |
sendPingFrame()
Send a empty ping frame
|
io.netty.util.concurrent.Future<Void> |
sendPingFrame(byte[] payload)
Send a ping frame with a byte array payload (limited to 125 bytes or less).
|
io.netty.util.concurrent.Future<Void> |
sendPingFrame(io.netty.buffer.ByteBuf payload)
Send a ping frame with a ByteBuf payload (limited to 125 bytes or less).
|
io.netty.util.concurrent.Future<Void> |
sendPongFrame()
Send a empty pong frame
|
io.netty.util.concurrent.Future<Void> |
sendPongFrame(byte[] payload)
Send a pong frame with a byte array payload (limited to 125 bytes or less).
|
io.netty.util.concurrent.Future<Void> |
sendPongFrame(io.netty.buffer.ByteBuf payload)
Send a pong frame with a ByteBuf payload (limited to 125 bytes or less).
|
io.netty.util.concurrent.Future<Void> |
sendTextFrame(io.netty.buffer.ByteBuf payload,
boolean finalFragment,
int rsv)
Allows sending a text frame with fragmentation or extension bits.
|
io.netty.util.concurrent.Future<Void> |
sendTextFrame(String payload)
Send a full text frame
|
io.netty.util.concurrent.Future<Void> |
sendTextFrame(String payload,
boolean finalFragment,
int rsv)
Allows sending a text frame with fragmentation or extension bits.
|
io.netty.handler.codec.http.HttpHeaders getUpgradeHeaders()
SocketAddress getRemoteAddress()
null if asynchronous provider is unable to provide the remote addressSocketAddress getLocalAddress()
null if asynchronous provider is unable to provide the local addressio.netty.util.concurrent.Future<Void> sendTextFrame(String payload)
payload - a text payloadio.netty.util.concurrent.Future<Void> sendTextFrame(String payload, boolean finalFragment, int rsv)
payload - a text fragment.finalFragment - flag indicating whether or not this is the final fragmentrsv - extension bits, 0 otherwiseio.netty.util.concurrent.Future<Void> sendTextFrame(io.netty.buffer.ByteBuf payload, boolean finalFragment, int rsv)
payload - a ByteBuf fragment.finalFragment - flag indicating whether or not this is the final fragmentrsv - extension bits, 0 otherwiseio.netty.util.concurrent.Future<Void> sendBinaryFrame(byte[] payload)
payload - a binary payloadio.netty.util.concurrent.Future<Void> sendBinaryFrame(byte[] payload, boolean finalFragment, int rsv)
payload - a binary payloadfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwiseio.netty.util.concurrent.Future<Void> sendBinaryFrame(io.netty.buffer.ByteBuf payload, boolean finalFragment, int rsv)
payload - a ByteBuf payloadfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwiseio.netty.util.concurrent.Future<Void> sendContinuationFrame(String payload, boolean finalFragment, int rsv)
payload - the text fragmentfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwiseio.netty.util.concurrent.Future<Void> sendContinuationFrame(byte[] payload, boolean finalFragment, int rsv)
payload - the binary fragmentfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwiseio.netty.util.concurrent.Future<Void> sendContinuationFrame(io.netty.buffer.ByteBuf payload, boolean finalFragment, int rsv)
payload - a ByteBuf fragmentfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwiseio.netty.util.concurrent.Future<Void> sendPingFrame()
io.netty.util.concurrent.Future<Void> sendPingFrame(byte[] payload)
payload - the payload.io.netty.util.concurrent.Future<Void> sendPingFrame(io.netty.buffer.ByteBuf payload)
payload - the payload.io.netty.util.concurrent.Future<Void> sendPongFrame()
io.netty.util.concurrent.Future<Void> sendPongFrame(byte[] payload)
payload - the payload.io.netty.util.concurrent.Future<Void> sendPongFrame(io.netty.buffer.ByteBuf payload)
payload - the payload.io.netty.util.concurrent.Future<Void> sendCloseFrame()
io.netty.util.concurrent.Future<Void> sendCloseFrame(int statusCode, String reasonText)
statusCode - a status codereasonText - a reasonboolean isOpen()
true if the WebSocket is open/connected.WebSocket addWebSocketListener(WebSocketListener l)
WebSocketListenerl - a WebSocketListenerWebSocket removeWebSocketListener(WebSocketListener l)
WebSocketListenerl - a WebSocketListenerCopyright © 2024. All rights reserved.