GeezerVison is showing netty.io — NioSocketChannel (Netty API Reference (4.1.141.Final))
Class NioSocketChannel
-
Nested Class Summary
Nested classes/interfaces inherited from interface Channel
Channel.Unsafe
Modifier and Type
Interface
Description
static interface
Unsafe operations that should never be called from user-code.
-
Field Summary
readInterestOp
Modifier and Type
Field
Description
protected final int
-
Constructor Summary
Constructors
Constructor
Description
Create a new instance using the given SelectorProvider and protocol family (supported only since JDK 15).
-
Method Summary
Modifier and Type
Method
Description
Returns the configuration of this channel.
protected void
protected void
protected boolean
Connect to the remote peer
protected void
Disconnect this Channel from its remote peer
protected void
protected int
Read bytes into the given ByteBuf and return the amount.
protected final void
Called when conditions justify shutting down the output portion of the channel.
protected void
Flush the content of the given buffer to the remote peer.
protected int
protected long
boolean
Return true if the Channel is active and so connected.
boolean
Returns true if and only if the remote peer shut down its output so that no more
data is received from this channel.
protected boolean
boolean
boolean
Determine if both the input and output of this channel have been shutdown.
Returns the local address where this channel is bound to.
Returns the parent of this channel.
Returns the remote address where this channel is connected to.
Will shutdown the input and output sides of this channel.
Will shutdown the input and output sides of this channel.
Shutdown the input side of the channel.
clearReadPending, doBeginRead, doDeregister, doRegister, eventLoop, isCompatible, isOpen, isReadPending, newDirectBuffer, newDirectBuffer, selectionKey, setReadPending, unsafe
Modifier and Type
Method
Description
protected final void
Set read pending to false.
protected void
Schedule a read operation.
protected void
protected void
Is called after the Channel is registered with its EventLoop as part of the register process.
protected boolean
Return true if the given EventLoop is compatible with this instance.
boolean
Returns true if the Channel is open and may get active later
protected boolean
Deprecated.
No longer supported.
Returns an off-heap copy of the specified ByteBuf, and releases the original one.
Returns an off-heap copy of the specified ByteBuf, and releases the specified holder.
protected void
Returns an internal-use-only object that provides unsafe operations.
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, equals, fileChannel, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlush
Modifier and Type
Method
Description
Request to bind to the given SocketAddress and notify the ChannelFuture once the operation
completes, either because the operation was successful or because of an error.
Request to bind to the given SocketAddress and notify the ChannelFuture once the operation
completes, either because the operation was successful or because of an error.
long
long
Request to close the Channel and notify the ChannelFuture once the operation completes,
either because the operation was successful or because of
an error.
Request to close the Channel and notify the ChannelFuture once the operation completes,
either because the operation was successful or because of
an error.
Returns the ChannelFuture which will be notified when this
channel is closed.
final int
Request to connect to the given SocketAddress and notify the ChannelFuture once the operation
completes, either because the operation was successful or because of an error.
Request to connect to the given SocketAddress and notify the ChannelFuture once the operation
completes, either because the operation was successful or because of an error.
Request to connect to the given SocketAddress while bind to the localAddress and notify the
ChannelFuture once the operation completes, either because the operation was successful or because of
an error.
Request to connect to the given SocketAddress while bind to the localAddress and notify the
ChannelFuture once the operation completes, either because the operation was successful or because of
an error.
Request to deregister from the previous assigned EventExecutor and notify the
ChannelFuture once the operation completes, either because the operation was successful or because of
an error.
Request to deregister from the previous assigned EventExecutor and notify the
ChannelFuture once the operation completes, either because the operation was successful or because of
an error.
Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes,
either because the operation was successful or because of an error.
Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes,
either because the operation was successful or because of an error.
final boolean
Returns true if and only if the specified object is identical
with this channel (i.e: this == o).
Returns the underlying FileChannel, or null if the region is not open.
Request to flush all pending messages via this ChannelOutboundInvoker.
final int
Returns the ID of this channel.
Returns the globally unique identifier of this Channel.
protected void
Deprecated.
no use-case for this.
protected void
Deprecated.
no use-case for this.
boolean
boolean
Returns true if and only if the I/O thread will perform the
requested write operation immediately.
protected final int
Returns the String representation of this channel.
protected void
Return a special ChannelPromise which can be reused for different operations.
attr, hasAttr
Modifier and Type
Method
Description
<T> boolean
-
Constructor Details
-
NioSocketChannel
public NioSocketChannel()
Create a new instance
-
-
NioSocketChannel
Create a new instance using the given SelectorProvider and protocol family (supported only since JDK 15).
-
-
NioSocketChannel
Create a new instance
- Parameters:
parent - the Channel which created this instance or null if it was created by the user
socket - the SocketChannel which will be used
-
Method Details
-
-
-
-
isActive
public boolean isActive()
Description copied from interface: Channel
Return true if the Channel is active and so connected.
- Specified by:
isActive in interface Channel
-
-
-
isShutdown
public boolean isShutdown()
Determine if both the input and output of this channel have been shutdown.
- Specified by:
isShutdown in interface DuplexChannel
-
-
-
doShutdownOutput
protected final void doShutdownOutput()
throws Exception
Called when conditions justify shutting down the output portion of the channel. This may happen if a write
operation throws an exception.
- Overrides:
doShutdownOutput in class AbstractChannel
- Throws:
Exception
-
-
-
-
-
-
shutdown
Will shutdown the input and output sides of this channel.
- Specified by:
shutdown in interface DuplexChannel
- Returns:
- will be completed when both shutdown operations complete.
-
shutdown
Will shutdown the input and output sides of this channel.
- Specified by:
shutdown in interface DuplexChannel
- Parameters:
promise - will be completed when both shutdown operations complete.
- Returns:
- will be completed when both shutdown operations complete.
-
-
-
-
-
-
-
-
-
-
-
-
|