io.netty5.channel.socket.SocketChannel which uses NIO selector based implementation.
io.netty5.channel.socket.SocketChannel ,
NioSocketChannel allows the following options in the option map:
ChannelOption |
INET |
INET6 |
{@code UNIX |
|---|---|---|---|
NioChannelOption | X | X | X |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBufferCollector | |
| private static final SelectorProvider | |
| private final ProtocolFamily | |
| private volatile boolean | |
| private static final Method | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | NioSocketChannel(EventLoop eventLoop, SelectorProvider provider)
Create a new instance using the given |
| public | NioSocketChannel(EventLoop eventLoop, SelectorProvider provider, ProtocolFamily family)
Create a new instance using the given |
| public | NioSocketChannel(EventLoop eventLoop, SocketChannel socket)
Create a new instance using the given |
| public | NioSocketChannel(NioServerSocketChannel
the parent, EventLoop Channel which created this instance or null if it was created by the userthe eventLoop, SocketChannel EventLoop to use for IO.the socket)SocketChannel which will be usedCreate a new instance |
| public | NioSocketChannel(NioServerSocketChannel
the parent, EventLoop Channel which created this instance or null if it was created by the userthe eventLoop, SocketChannel EventLoop to use for IO.the socket, ProtocolFamily SocketChannel which will be usedthe family)ProtocolFamily that was used to create th SocketChannelCreate a new instance |
| Modifier and Type | Method and Description |
|---|---|
| protected void | doBind(SocketAddress
the localAddress)SocketAddress to bound to.Implements abstract io. Channel to the SocketAddress
|
| private void | |
| protected boolean | doConnect(SocketAddress
the address of the remote peer. remoteAddress, SocketAddress the local address of this channel. localAddress, Buffer the initial data that is written during connect
(if data)ChannelOption#TCP_FASTOPEN_CONNECT is supported and configured).
If data is written care must be taken to update the
reader offset.Implements abstract io. |
| protected void | doDisconnect()
Implements abstract io. Channel from its remote peer
|
| protected boolean | doFinishConnect(SocketAddress
the remote address of the peer. requestedRemoteAddress)Implements abstract io. |
| protected int | doReadBytes(Buffer buffer)
Implements abstract io. Buffer and return the amount.
|
| protected void | doShutdown(ChannelShutdownDirection
the direction to shut down. direction)Implements abstract io. Channel.
|
| protected int | doWriteBytes(Buffer
the buf)Buffer from which the bytes should be writtenImplements abstract io. Buffer to the underlying java..
|
| protected long | doWriteFileRegion(FileRegion
the region)FileRegion from which the bytes should be writtenImplements abstract io. FileRegion
|
| protected void | doWriteNow(AbstractChannel<NioServerSocketChannel, SocketAddress, SocketAddress>.
the writeSinkWriteSink that must be completed with the write
progress.
WriteSink#complete(long, long, int, boolean) or
WriteSink#complete(long, Throwable, boolean) must be called
exactly once before this method returns non-exceptional.Overrides io. false or there are
no more messages to write.
|
| protected <T> T | getExtendedOption(ChannelOption<T>
the option)ChannelOption.Overrides io. ChannelOptions.
|
| public boolean | isActive()
Implements io. true if the Channel is active and so connected.
|
| protected boolean | isExtendedOptionSupported(ChannelOption<?>
the option)ChannelOption.Overrides io. ChannelOptions.
|
| public boolean | isShutdown(ChannelShutdownDirection direction)
Implements io. true if the ChannelShutdownDirection of the Channel was shutdown before.
|
| protected SocketChannel | |
| protected SocketAddress | localAddress0()
Implements abstract io. SocketAddress which is bound locally.
|
| private static SocketChannel | |
| protected Future | prepareToClose()
Overrides io. Channel.
|
| protected SocketAddress | remoteAddress0()
Implements abstract io. SocketAddress which the Channel is connected to.
|
| protected <T> void | setExtendedOption(ChannelOption<T>
the option, T value)ChannelOption.Overrides io. ChannelOptions.
|
| collector | back to summary |
|---|---|
| private final ByteBufferCollector collector | |
| DEFAULT_SELECTOR_PROVIDER | back to summary |
|---|---|
| private static final SelectorProvider DEFAULT_SELECTOR_PROVIDER | |
| family | back to summary |
|---|---|
| private final ProtocolFamily family | |
| inputShutdown | back to summary |
|---|---|
| private volatile boolean inputShutdown | |
| OPEN_SOCKET_CHANNEL_WITH_FAMILY | back to summary |
|---|---|
| private static final Method OPEN_SOCKET_CHANNEL_WITH_FAMILY | |
| outputShutdown | back to summary |
|---|---|
| private volatile boolean outputShutdown | |
| NioSocketChannel | back to summary |
|---|---|
| public NioSocketChannel(EventLoop eventLoop) Create a new instance | |
| NioSocketChannel | back to summary |
|---|---|
| public NioSocketChannel(EventLoop eventLoop, SelectorProvider provider) Create a new instance using the given | |
| NioSocketChannel | back to summary |
|---|---|
| public NioSocketChannel(EventLoop eventLoop, SelectorProvider provider, ProtocolFamily family) Create a new instance using the given | |
| NioSocketChannel | back to summary |
|---|---|
| public NioSocketChannel(EventLoop eventLoop, SocketChannel socket) Create a new instance using the given | |
| NioSocketChannel | back to summary |
|---|---|
| public NioSocketChannel(NioServerSocketChannel parent, EventLoop eventLoop, SocketChannel socket) Create a new instance
| |
| NioSocketChannel | back to summary |
|---|---|
| public NioSocketChannel(NioServerSocketChannel parent, EventLoop eventLoop, SocketChannel socket, ProtocolFamily family) Create a new instance
| |
| doBind | back to summary |
|---|---|
| protected void doBind(SocketAddress localAddress) throws Exception Implements abstract io. Doc from io. Bind the
| |
| doBind0 | back to summary |
|---|---|
| private void doBind0(SocketAddress localAddress) throws Exception | |
| doConnect | back to summary |
|---|---|
| protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress, Buffer data) throws Exception Implements abstract io. Doc from io. Connect to remote peer. This method should never be directly called.
| |
| doDisconnect | back to summary |
|---|---|
| protected void doDisconnect() throws Exception Implements abstract io. Doc from io. Disconnect this | |
| doFinishConnect | back to summary |
|---|---|
| protected boolean doFinishConnect(SocketAddress requestedRemoteAddress) throws Exception Implements abstract io. Doc from io. Finish a connect request. This method should never be directly called, use
| |
| doReadBytes | back to summary |
|---|---|
| protected int doReadBytes(Buffer buffer) throws Exception Implements abstract io. Doc from io. Read bytes into the given
| |
| doShutdown | back to summary |
|---|---|
| protected void doShutdown(ChannelShutdownDirection direction) throws Exception Implements abstract io. Doc from io. Shutdown one direction of the
| |
| doWriteBytes | back to summary |
|---|---|
| protected int doWriteBytes(Buffer buf) throws Exception Implements abstract io. Doc from io. Write bytes form the given | |
| doWriteFileRegion | back to summary |
|---|---|
| protected long doWriteFileRegion(FileRegion region) throws Exception Implements abstract io. Doc from io. Write a
| |
| doWriteNow | back to summary |
|---|---|
| protected void doWriteNow(AbstractChannel<NioServerSocketChannel, SocketAddress, SocketAddress>. Overrides io. Doc from io. Called in a loop when writes should be performed until this method returns
| |
| getExtendedOption | back to summary |
|---|---|
| protected <T> T getExtendedOption(ChannelOption<T> option) Overrides io. Doc from io. Override to add support for more
| |
| isActive | back to summary |
|---|---|
| public boolean isActive() Implements io. Doc from io. Return
| |
| isExtendedOptionSupported | back to summary |
|---|---|
| protected boolean isExtendedOptionSupported(ChannelOption<?> option) Overrides io. Doc from io. Override to add support for more
| |
| isShutdown | back to summary |
|---|---|
| public boolean isShutdown(ChannelShutdownDirection direction) Implements io. Doc from io. Returns
| |
| javaChannel | back to summary |
|---|---|
| protected SocketChannel javaChannel() Overrides io.
| |
| localAddress0 | back to summary |
|---|---|
| protected SocketAddress localAddress0() Implements abstract io. Doc from io. Returns the
| |
| newChannel | back to summary |
|---|---|
| private static SocketChannel newChannel(SelectorProvider provider, ProtocolFamily family) | |
| prepareToClose | back to summary |
|---|---|
| protected Future Overrides io. Doc from io. Prepares to close the
| |
| remoteAddress0 | back to summary |
|---|---|
| protected SocketAddress remoteAddress0() Implements abstract io. Doc from io. Return the
| |
| setExtendedOption | back to summary |
|---|---|
| protected <T> void setExtendedOption(ChannelOption<T> option, T value) Overrides io. Doc from io. Override to add support for more
| |