public interface WebSocketConnection
| Modifier and Type | Method and Description |
|---|---|
io.netty.channel.ChannelFuture |
finishConnectionClosure()
Finish the connection closure if a close frame has been received without this connection sending a close frame.
|
io.netty.channel.ChannelFuture |
finishConnectionClosure(int statusCode,
String reason)
Finish the connection closure if a close frame has been received without this connection sending a close frame.
|
String |
getChannelId()
Retrieve the Channel ID of the connection.
|
String |
getHost()
Retrieve the host of the connection.
|
String |
getNegotiatedSubProtocol()
Retrieve the negotiated sub-protocol during WebSocket handshake.
|
int |
getPort()
Retrieve the port of the connection.
|
io.netty.channel.ChannelFuture |
initiateConnectionClosure()
Initiates connection closure.
|
io.netty.channel.ChannelFuture |
initiateConnectionClosure(int statusCode,
String reason)
Initiates connection closure.
|
boolean |
isOpen()
Check if the connection is open.
|
boolean |
isSecure()
Check if the connection is secure.
|
io.netty.channel.ChannelFuture |
ping(ByteBuffer data)
Ping remote endpoint asynchronously.
|
io.netty.channel.ChannelFuture |
pong(ByteBuffer data)
Send pong to remote endpoint asynchronously.
|
io.netty.channel.ChannelFuture |
pushBinary(ByteBuffer data)
Push binary frame to the WebSocket connection asynchronously.
|
io.netty.channel.ChannelFuture |
pushBinary(ByteBuffer data,
boolean finalFrame)
Push binary frame to the WebSocket connection asynchronously.
|
io.netty.channel.ChannelFuture |
pushText(String text)
Push text frame to the WebSocket connection asynchronously.
|
io.netty.channel.ChannelFuture |
pushText(String text,
boolean finalFrame)
Push text frame to the WebSocket connection asynchronously.
|
void |
readNextFrame()
Reading WebSocket frames after successful handshake is blocked by default in transport level.
|
void |
startReadingFrames()
Reading WebSocket frames after successful handshake is blocked by default in transport level.
|
void |
stopReadingFrames()
Stop reading WebSocket frames from the wire.
|
io.netty.channel.ChannelFuture |
terminateConnection()
Terminate connection without close frame.
|
io.netty.channel.ChannelFuture |
terminateConnection(int statusCode,
String reason)
Send a close frame and close the connection without waiting for a response.
|
String getChannelId()
boolean isOpen()
boolean isSecure()
String getHost()
int getPort()
String getNegotiatedSubProtocol()
void readNextFrame()
void startReadingFrames()
void stopReadingFrames()
io.netty.channel.ChannelFuture pushText(String text)
text - text to be sentio.netty.channel.ChannelFuture pushText(String text, boolean finalFrame)
text - text to be sentfinalFrame - true if sending final frameio.netty.channel.ChannelFuture pushBinary(ByteBuffer data)
data - binary data to be sentio.netty.channel.ChannelFuture pushBinary(ByteBuffer data, boolean finalFrame)
data - binary data to be sentfinalFrame - true if sending final frameio.netty.channel.ChannelFuture ping(ByteBuffer data)
data - data to be sent with ping frameio.netty.channel.ChannelFuture pong(ByteBuffer data)
data - data to be sent with ping frameio.netty.channel.ChannelFuture initiateConnectionClosure(int statusCode,
String reason)
ChannelFuture will complete operation successfully if and only if it
receives back a echoed close WebSocket frame from the remote endpoint with the same status code as was written.
Also ChannelFuture will not reach operationComplete state until it receives a close WebSocket frame
from the remote endpoint. If user does not need to wait for the echoed back WebSocket frame from the remote
endpoint, user need to handle it separately.statusCode - Status code to indicate the reason of closurereason - Reason to close the connectionio.netty.channel.ChannelFuture initiateConnectionClosure()
ChannelFuture will complete operation successfully if and only if it
receives back a echoed close WebSocket frame from the remote endpoint with the same status code as was written.
Also ChannelFuture will not reach operationComplete state until it receives a close WebSocket frame from
the remote endpoint. If user does not need to wait for the echoed back WebSocket frame from the remote endpoint,
user need to handle it separately.io.netty.channel.ChannelFuture finishConnectionClosure(int statusCode,
String reason)
statusCode - Status code to indicate the reason of closurereason - Reason to close the connectionio.netty.channel.ChannelFuture finishConnectionClosure()
io.netty.channel.ChannelFuture terminateConnection()
io.netty.channel.ChannelFuture terminateConnection(int statusCode,
String reason)
statusCode - Status code to indicate the reason of closurereason - Reason to close the connectionCopyright © 2022 WSO2. All rights reserved.