Top Description Fields Constructors Methods
io.netty5.channel

public abstract Class AbstractServerChannel<P extends Channel, L extends SocketAddress, R extends SocketAddress>

extends AbstractChannel<P extends Channel, L extends SocketAddress, R extends SocketAddress>
implements ServerChannel
Class Inheritance
All Implemented Interfaces
io.netty5.channel.ServerChannel, io.netty5.channel.Channel, io.netty5.channel.IoHandle, java.lang.Comparable, io.netty5.channel.ChannelOutboundInvoker, io.netty5.util.concurrent.FuturePromiseFactory, io.netty5.util.AttributeMap
Known Direct Subclasses
io.netty5.channel.local.LocalServerChannel
Imports
io.netty5.buffer.Buffer, java.net.SocketAddress

A skeletal ServerChannel implementation.

Field Summary

Modifier and TypeField and Description
private final EventLoopGroup

Constructor Summary

AccessConstructor and Description
protected
AbstractServerChannel(EventLoop eventLoop, EventLoopGroup childEventLoopGroup, Class<? extends Channel> childChannelType)

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public final EventLoopGroup
childEventLoopGroup()

Implements io.netty5.channel.ServerChannel.childEventLoopGroup.

Returns the EventLoopGroup that is used to register the child Channels on after accepting these.
protected final 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 ChannelOption#TCP_FASTOPEN_CONNECT is supported and configured). If data is written care must be taken to update the reader offset.
initialData
)

Implements abstract io.netty5.channel.AbstractChannel.doConnect.

Connect to remote peer.
protected final void
doDisconnect()

Implements abstract io.netty5.channel.AbstractChannel.doDisconnect.

Disconnect this Channel from its remote peer
protected final boolean
doFinishConnect(R
the remote address of the peer.
requestedRemoteAddress
)

Implements abstract io.netty5.channel.AbstractChannel.doFinishConnect.

Finish a connect request.
protected final void
doShutdown(ChannelShutdownDirection
the direction to shut down.
direction
)

Implements abstract io.netty5.channel.AbstractChannel.doShutdown.

Shutdown one direction of the Channel.
protected final void
doWriteNow(AbstractChannel<P, L, R>.WriteSink
the WriteSink 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.
writeSink
)

Implements abstract io.netty5.channel.AbstractChannel.doWriteNow.

Called in a loop when writes should be performed until this method returns false or there are no more messages to write.
protected final Object
filterOutboundMessage(Object
the message to filter / convert.
msg
)

Overrides io.netty5.channel.AbstractChannel.filterOutboundMessage.

Invoked when a new message is added to to the outbound queue of this AbstractChannel, so that the Channel implementation converts the message to another.
public final boolean
isShutdown(ChannelShutdownDirection direction)

Implements io.netty5.channel.Channel.isShutdown.

Returns true if the ChannelShutdownDirection of the Channel was shutdown before.
protected final R
remoteAddress0()

Implements abstract io.netty5.channel.AbstractChannel.remoteAddress0.

Return the SocketAddress which the Channel is connected to.
Inherited from io.netty5.channel.AbstractChannel:
bufferAllocatorcacheAddressescloseFuturecloseTransportcompareTodoBinddoClearScheduledReaddoClosedoReaddoReadNowequalsexecutorfinishConnectgetExtendedOptiongetOptionhashCodeidisConnectPendingisExtendedOptionSupportedisOptionSupportedisReadPendingisRegisteredisSupportingDisconnectisWriteFlushedScheduledlocalAddresslocalAddress0newChannelPipelinenewSupportedIdentityOptionsSetparentpipelineprepareToClosereadBufferAllocatorreadHandlereadIfIsAutoReadreadLoopCompletereadNowremoteAddresssetExtendedOptionsetOptionshutdownReadSidetoStringvalidateEventLoopGroupvalidateFileRegionwritableByteswriteFlushedwriteFlushedNowwriteHandlewriteLoopComplete

Field Detail

childEventLoopGroupback to summary
private final EventLoopGroup childEventLoopGroup

Constructor Detail

AbstractServerChannelback to summary
protected AbstractServerChannel(EventLoop eventLoop, EventLoopGroup childEventLoopGroup, Class<? extends Channel> childChannelType)

Creates a new instance.

Method Detail

childEventLoopGroupback to summary
public final EventLoopGroup childEventLoopGroup()

Implements io.netty5.channel.ServerChannel.childEventLoopGroup.

Doc from io.netty5.channel.ServerChannel.childEventLoopGroup.

Returns the EventLoopGroup that is used to register the child Channels on after accepting these.

Annotations
@Override
doConnectback to summary
protected final boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress, Buffer initialData)

Implements abstract io.netty5.channel.AbstractChannel.doConnect.

Doc from io.netty5.channel.AbstractChannel.doConnect.

Connect to remote peer. This method should never be directly called.

Parameters
remoteAddress:SocketAddress

the address of the remote peer.

localAddress:SocketAddress

the local address of this channel.

initialData:Buffer

the initial data that is written during connect (if ChannelOption#TCP_FASTOPEN_CONNECT is supported and configured). If data is written care must be taken to update the reader offset.

Returns:boolean

true if the connect operation was completed, false if finishConnect() will be called later again to try finish connecting.

Annotations
@Override
doDisconnectback to summary
protected final void doDisconnect()

Implements abstract io.netty5.channel.AbstractChannel.doDisconnect.

Doc from io.netty5.channel.AbstractChannel.doDisconnect.

Disconnect this Channel from its remote peer

Annotations
@Override
doFinishConnectback to summary
protected final boolean doFinishConnect(R requestedRemoteAddress)

Implements abstract io.netty5.channel.AbstractChannel.doFinishConnect.

Doc from io.netty5.channel.AbstractChannel.doFinishConnect.

Finish a connect request. This method should never be directly called, use finishConnect() instead.

Parameters
requestedRemoteAddress:R

the remote address of the peer.

Returns:boolean

true if the connect operations was completed, false if finishConnect() will be called later again to try finishing the connect operation.

Annotations
@Override
doShutdownback to summary
protected final void doShutdown(ChannelShutdownDirection direction)

Implements abstract io.netty5.channel.AbstractChannel.doShutdown.

Doc from io.netty5.channel.AbstractChannel.doShutdown.

Shutdown one direction of the Channel.

Parameters
direction:ChannelShutdownDirection

the direction to shut down.

Annotations
@Override
doWriteNowback to summary
protected final void doWriteNow(AbstractChannel<P, L, R>.WriteSink writeSink)

Implements abstract io.netty5.channel.AbstractChannel.doWriteNow.

Doc from io.netty5.channel.AbstractChannel.doWriteNow.

Called in a loop when writes should be performed until this method returns false or there are no more messages to write. Implementations are responsible for handling partial writes, which for example means that if Buffers are written partial implementations need to ensure the readerOffset is updated accordingly.

Parameters
writeSink:AbstractChannel<P, L, R>.WriteSink

the WriteSink 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.

Annotations
@Override
filterOutboundMessageback to summary
protected final Object filterOutboundMessage(Object msg)

Overrides io.netty5.channel.AbstractChannel.filterOutboundMessage.

Doc from io.netty5.channel.AbstractChannel.filterOutboundMessage.

Invoked when a new message is added to to the outbound queue of this AbstractChannel, so that the Channel implementation converts the message to another. (e.g. heap buffer -> direct buffer)

Parameters
msg:Object

the message to filter / convert.

Annotations
@Override
isShutdownback to summary
public final boolean isShutdown(ChannelShutdownDirection direction)

Implements io.netty5.channel.Channel.isShutdown.

Doc from io.netty5.channel.Channel.isShutdown.

Returns true if the ChannelShutdownDirection of the Channel was shutdown before.

Annotations
@Override
remoteAddress0back to summary
protected final R remoteAddress0()

Implements abstract io.netty5.channel.AbstractChannel.remoteAddress0.

Doc from io.netty5.channel.AbstractChannel.remoteAddress0.

Return the SocketAddress which the Channel is connected to.

Returns:R

the remote address if any, null otherwise.

Annotations
@Override