| Modifier and Type | Field and Description |
|---|---|
protected io.netty.channel.Channel |
channel |
| Constructor and Description |
|---|
NettyWebSocket(io.netty.channel.Channel channel,
io.netty.handler.codec.http.HttpHeaders upgradeHeaders) |
| Modifier and Type | Method and Description |
|---|---|
WebSocket |
addWebSocketListener(WebSocketListener l)
Add a
WebSocketListener |
void |
bufferFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame frame) |
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() |
void |
handleFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame frame) |
boolean |
isOpen() |
boolean |
isReady() |
void |
onClose(int code,
String reason) |
void |
onError(Throwable t) |
void |
processBufferedFrames() |
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 message)
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.
|
String |
toString() |
public NettyWebSocket(io.netty.channel.Channel channel,
io.netty.handler.codec.http.HttpHeaders upgradeHeaders)
public io.netty.handler.codec.http.HttpHeaders getUpgradeHeaders()
getUpgradeHeaders in interface WebSocketpublic SocketAddress getRemoteAddress()
WebSocketgetRemoteAddress in interface WebSocketnull if asynchronous provider is unable to provide the remote addresspublic SocketAddress getLocalAddress()
WebSocketgetLocalAddress in interface WebSocketnull if asynchronous provider is unable to provide the local addresspublic io.netty.util.concurrent.Future<Void> sendTextFrame(String message)
WebSocketsendTextFrame in interface WebSocketmessage - a text payloadpublic io.netty.util.concurrent.Future<Void> sendTextFrame(String payload, boolean finalFragment, int rsv)
WebSocketsendTextFrame in interface WebSocketpayload - a text fragment.finalFragment - flag indicating whether or not this is the final fragmentrsv - extension bits, 0 otherwisepublic io.netty.util.concurrent.Future<Void> sendTextFrame(io.netty.buffer.ByteBuf payload, boolean finalFragment, int rsv)
WebSocketsendTextFrame in interface WebSocketpayload - a ByteBuf fragment.finalFragment - flag indicating whether or not this is the final fragmentrsv - extension bits, 0 otherwisepublic io.netty.util.concurrent.Future<Void> sendBinaryFrame(byte[] payload)
WebSocketsendBinaryFrame in interface WebSocketpayload - a binary payloadpublic io.netty.util.concurrent.Future<Void> sendBinaryFrame(byte[] payload, boolean finalFragment, int rsv)
WebSocketsendBinaryFrame in interface WebSocketpayload - a binary payloadfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwisepublic io.netty.util.concurrent.Future<Void> sendBinaryFrame(io.netty.buffer.ByteBuf payload, boolean finalFragment, int rsv)
WebSocketsendBinaryFrame in interface WebSocketpayload - a ByteBuf payloadfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwisepublic io.netty.util.concurrent.Future<Void> sendContinuationFrame(String payload, boolean finalFragment, int rsv)
WebSocketsendContinuationFrame in interface WebSocketpayload - the text fragmentfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwisepublic io.netty.util.concurrent.Future<Void> sendContinuationFrame(byte[] payload, boolean finalFragment, int rsv)
WebSocketsendContinuationFrame in interface WebSocketpayload - the binary fragmentfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwisepublic io.netty.util.concurrent.Future<Void> sendContinuationFrame(io.netty.buffer.ByteBuf payload, boolean finalFragment, int rsv)
WebSocketsendContinuationFrame in interface WebSocketpayload - a ByteBuf fragmentfinalFragment - flag indicating whether or not this is the last fragmentrsv - extension bits, 0 otherwisepublic io.netty.util.concurrent.Future<Void> sendPingFrame()
WebSocketsendPingFrame in interface WebSocketpublic io.netty.util.concurrent.Future<Void> sendPingFrame(byte[] payload)
WebSocketsendPingFrame in interface WebSocketpayload - the payload.public io.netty.util.concurrent.Future<Void> sendPingFrame(io.netty.buffer.ByteBuf payload)
WebSocketsendPingFrame in interface WebSocketpayload - the payload.public io.netty.util.concurrent.Future<Void> sendPongFrame()
WebSocketsendPongFrame in interface WebSocketpublic io.netty.util.concurrent.Future<Void> sendPongFrame(byte[] payload)
WebSocketsendPongFrame in interface WebSocketpayload - the payload.public io.netty.util.concurrent.Future<Void> sendPongFrame(io.netty.buffer.ByteBuf payload)
WebSocketsendPongFrame in interface WebSocketpayload - the payload.public io.netty.util.concurrent.Future<Void> sendCloseFrame()
WebSocketsendCloseFrame in interface WebSocketpublic io.netty.util.concurrent.Future<Void> sendCloseFrame(int statusCode, String reasonText)
WebSocketsendCloseFrame in interface WebSocketstatusCode - a status codereasonText - a reasonpublic boolean isOpen()
public WebSocket addWebSocketListener(WebSocketListener l)
WebSocketWebSocketListeneraddWebSocketListener in interface WebSocketl - a WebSocketListenerpublic WebSocket removeWebSocketListener(WebSocketListener l)
WebSocketWebSocketListenerremoveWebSocketListener in interface WebSocketl - a WebSocketListenerpublic boolean isReady()
public void bufferFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
public void processBufferedFrames()
public void handleFrame(io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
public void onError(Throwable t)
public void onClose(int code,
String reason)
Copyright © 2024. All rights reserved.