public interface IWsSession<T>
| 限定符和类型 | 方法和说明 |
|---|---|
default io.netty.buffer.ByteBufAllocator |
alloc()
Return the assigned
ByteBufAllocator which will be used to allocate ByteBufs. |
default long |
bytesBeforeUnwritable()
Get how many bytes can be written until
isWritable() returns false. |
default long |
bytesBeforeWritable()
Get how many bytes must be drained from underlying buffers until
isWritable() returns true. |
default io.netty.channel.ChannelFuture |
close() |
default io.netty.channel.ChannelFuture |
close(io.netty.channel.ChannelPromise promise) |
default io.netty.channel.ChannelFuture |
closeFuture()
Returns the
ChannelFuture which will be notified when this
channel is closed. |
default io.netty.channel.ChannelConfig |
config()
Returns the configuration of this channel.
|
default io.netty.channel.Channel |
flush() |
default <T> T |
getAttribute(String name) |
io.netty.channel.Channel |
getChannel() |
T |
getUserId() |
default io.netty.channel.ChannelId |
id()
Returns the globally unique identifier of this
Channel. |
default boolean |
isActive()
Return
true if the Channel is active and so connected. |
default boolean |
isOpen()
Returns
true if the Channel is open and may get active later |
default boolean |
isRegistered()
Returns
true if the Channel is registered with an EventLoop. |
default boolean |
isWritable()
Returns
true if and only if the I/O thread will perform the
requested write operation immediately. |
default SocketAddress |
localAddress()
Returns the local address where this channel is bound to.
|
default io.netty.channel.ChannelMetadata |
metadata()
Return the
ChannelMetadata of the Channel which describe the nature of the Channel. |
default io.netty.channel.ChannelPipeline |
pipeline()
Return the assigned
ChannelPipeline. |
default io.netty.channel.Channel |
read() |
default SocketAddress |
remoteAddress()
Returns the remote address where this channel is connected to.
|
default io.netty.channel.ChannelFuture |
sendBinary(io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame binaryWebSocketFrame) |
default io.netty.channel.ChannelFuture |
sendBinary(byte[] bytes) |
default io.netty.channel.ChannelFuture |
sendBinary(io.netty.buffer.ByteBuf byteBuf) |
default io.netty.channel.ChannelFuture |
sendBinary(ByteBuffer byteBuffer) |
default io.netty.channel.ChannelFuture |
sendText(io.netty.buffer.ByteBuf byteBuf) |
default io.netty.channel.ChannelFuture |
sendText(ByteBuffer byteBuffer) |
default io.netty.channel.ChannelFuture |
sendText(String message) |
default io.netty.channel.ChannelFuture |
sendText(io.netty.handler.codec.http.websocketx.TextWebSocketFrame textWebSocketFrame) |
default <T> void |
setAttribute(String name,
T value) |
void |
setChannel(io.netty.channel.Channel channel) |
default void |
setSubProtocols(String subProtocols) |
void |
setUserId(T userId) |
default io.netty.channel.Channel.Unsafe |
unsafe()
Returns an internal-use-only object that provides unsafe operations.
|
T getUserId()
void setUserId(T userId)
io.netty.channel.Channel getChannel()
void setChannel(io.netty.channel.Channel channel)
default void setSubProtocols(String subProtocols)
default io.netty.channel.ChannelFuture sendText(String message)
default io.netty.channel.ChannelFuture sendText(io.netty.buffer.ByteBuf byteBuf)
default io.netty.channel.ChannelFuture sendText(ByteBuffer byteBuffer)
default io.netty.channel.ChannelFuture sendText(io.netty.handler.codec.http.websocketx.TextWebSocketFrame textWebSocketFrame)
default io.netty.channel.ChannelFuture sendBinary(byte[] bytes)
default io.netty.channel.ChannelFuture sendBinary(io.netty.buffer.ByteBuf byteBuf)
default io.netty.channel.ChannelFuture sendBinary(ByteBuffer byteBuffer)
default io.netty.channel.ChannelFuture sendBinary(io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame binaryWebSocketFrame)
default <T> void setAttribute(String name, T value)
default <T> T getAttribute(String name)
default io.netty.channel.ChannelId id()
Channel.default io.netty.channel.ChannelConfig config()
default boolean isOpen()
true if the Channel is open and may get active laterdefault boolean isRegistered()
true if the Channel is registered with an EventLoop.default boolean isActive()
true if the Channel is active and so connected.default io.netty.channel.ChannelMetadata metadata()
ChannelMetadata of the Channel which describe the nature of the Channel.default SocketAddress localAddress()
SocketAddress is supposed to be down-cast into more concrete
type such as InetSocketAddress to retrieve the detailed
information.null if this channel is not bound.default SocketAddress remoteAddress()
SocketAddress is supposed to be down-cast into more
concrete type such as InetSocketAddress to retrieve the detailed
information.null if this channel is not connected.
If this channel is not connected but it can receive messages
from arbitrary remote addresses (e.g. DatagramChannel,
use DefaultAddressedEnvelope.recipient() to determine
the origination of the received message as this method will
return null.default io.netty.channel.ChannelFuture closeFuture()
ChannelFuture which will be notified when this
channel is closed. This method always returns the same future instance.default boolean isWritable()
true if and only if the I/O thread will perform the
requested write operation immediately. Any write requests made when
this method returns false are queued until the I/O thread is
ready to process the queued write requests.default long bytesBeforeUnwritable()
isWritable() returns false.
This quantity will always be non-negative. If isWritable() is false then 0.default long bytesBeforeWritable()
isWritable() returns true.
This quantity will always be non-negative. If isWritable() is true then 0.default io.netty.channel.Channel.Unsafe unsafe()
default io.netty.channel.ChannelPipeline pipeline()
ChannelPipeline.default io.netty.buffer.ByteBufAllocator alloc()
ByteBufAllocator which will be used to allocate ByteBufs.default io.netty.channel.Channel read()
default io.netty.channel.Channel flush()
default io.netty.channel.ChannelFuture close()
default io.netty.channel.ChannelFuture close(io.netty.channel.ChannelPromise promise)
Copyright © 2022. All rights reserved.