Top Description Inners Fields Constructors Methods
io.netty.channel

public abstract Class AbstractServerChannel

extends AbstractChannel
implements ServerChannel
Class Inheritance
All Implemented Interfaces
io.netty.channel.ServerChannel, io.netty.channel.Channel, java.lang.Comparable, io.netty.channel.ChannelOutboundInvoker, io.netty.util.AttributeMap
Known Direct Subclasses
io.netty.channel.local.LocalServerChannel
Imports
java.net.SocketAddress

A skeletal server-side Channel implementation. A server-side Channel does not allow the following operations:

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private static final ChannelMetadata

Constructor Summary

AccessConstructor and Description
protected
AbstractServerChannel()

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
protected void
doDisconnect()

Implements abstract io.netty.channel.AbstractChannel.doDisconnect.

Disconnect this Channel from its remote peer
protected void
doWrite(ChannelOutboundBuffer in)

Implements abstract io.netty.channel.AbstractChannel.doWrite.

Flush the content of the given buffer to the remote peer.
protected final Object
filterOutboundMessage(Object msg)

Overrides io.netty.channel.AbstractChannel.filterOutboundMessage.

Invoked when a new message is added to a ChannelOutboundBuffer of this AbstractChannel, so that the Channel implementation converts the message to another.
public ChannelMetadata
metadata()

Implements io.netty.channel.Channel.metadata.

Return the ChannelMetadata of the Channel which describe the nature of the Channel.
protected AbstractChannel.AbstractUnsafe
newUnsafe()

Implements abstract io.netty.channel.AbstractChannel.newUnsafe.

Create a new AbstractUnsafe instance which will be used for the life-time of the Channel
public SocketAddress
remoteAddress()

Overrides io.netty.channel.AbstractChannel.remoteAddress.

Implements io.netty.channel.Channel.remoteAddress.

Returns the remote address where this channel is connected to.
protected SocketAddress
remoteAddress0()

Implements abstract io.netty.channel.AbstractChannel.remoteAddress0.

Return the SocketAddress which the Channel is connected to.
Inherited from io.netty.channel.AbstractChannel:
allocbindbindbytesBeforeUnwritablebytesBeforeWritablecloseclosecloseFuturecompareToconnectconnectconnectconnectderegisterderegisterdisconnectdisconnectdoBeginReaddoBinddoClosedoDeregisterdoRegisterdoShutdownOutputequalseventLoopflushhashCodeidinvalidateLocalAddressinvalidateRemoteAddressisCompatibleisRegisteredisWritablelocalAddresslocalAddress0maxMessagesPerWritenewChannelPipelinenewFailedFuturenewIdnewProgressivePromisenewPromisenewSucceededFutureparentpipelinereadtoStringunsafevalidateFileRegionvoidPromisewritewritewriteAndFlushwriteAndFlush

Field Detail

METADATAback to summary
private static final ChannelMetadata METADATA

Constructor Detail

AbstractServerChannelback to summary
protected AbstractServerChannel()

Creates a new instance.

Method Detail

doDisconnectback to summary
protected void doDisconnect() throws Exception

Implements abstract io.netty.channel.AbstractChannel.doDisconnect.

Doc from io.netty.channel.AbstractChannel.doDisconnect.

Disconnect this Channel from its remote peer

Annotations
@Override
doWriteback to summary
protected void doWrite(ChannelOutboundBuffer in) throws Exception

Implements abstract io.netty.channel.AbstractChannel.doWrite.

Doc from io.netty.channel.AbstractChannel.doWrite.

Flush the content of the given buffer to the remote peer.

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

Overrides io.netty.channel.AbstractChannel.filterOutboundMessage.

Doc from io.netty.channel.AbstractChannel.filterOutboundMessage.

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

Annotations
@Override
metadataback to summary
public ChannelMetadata metadata()

Implements io.netty.channel.Channel.metadata.

Doc from io.netty.channel.Channel.metadata.

Return the ChannelMetadata of the Channel which describe the nature of the Channel.

Annotations
@Override
newUnsafeback to summary
protected AbstractChannel.AbstractUnsafe newUnsafe()

Implements abstract io.netty.channel.AbstractChannel.newUnsafe.

Doc from io.netty.channel.AbstractChannel.newUnsafe.

Create a new AbstractUnsafe instance which will be used for the life-time of the Channel

Annotations
@Override
remoteAddressback to summary
public SocketAddress remoteAddress()

Overrides io.netty.channel.AbstractChannel.remoteAddress.

Implements io.netty.channel.Channel.remoteAddress.

Doc from io.netty.channel.Channel.remoteAddress.

Returns the remote address where this channel is connected to. The returned SocketAddress is supposed to be down-cast into more concrete type such as InetSocketAddress to retrieve the detailed information.

Returns:SocketAddress

the remote address of this channel. 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 DatagramPacket#recipient() to determine the origination of the received message as this method will return null.

Annotations
@Override
remoteAddress0back to summary
protected SocketAddress remoteAddress0()

Implements abstract io.netty.channel.AbstractChannel.remoteAddress0.

Doc from io.netty.channel.AbstractChannel.remoteAddress0.

Return the SocketAddress which the Channel is connected to.

Annotations
@Override
io.netty.channel back to summary

private final Class AbstractServerChannel.DefaultServerUnsafe

extends AbstractUnsafe
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)

Implements io.netty.channel.Channel.Unsafe.connect.

Connect the Channel of the given ChannelFuture with the given remote SocketAddress.
Inherited from io.netty.channel.AbstractChannel.AbstractUnsafe:
annotateConnectExceptionbeginReadbindclosecloseForciblycloseIfClosedderegisterdisconnectensureOpenflushflush0handleWriteErrorlocalAddressoutboundBufferprepareToCloserecvBufAllocHandleregisterremoteAddresssafeSetFailuresafeSetSuccessshutdownOutputvoidPromisewrite

Constructor Detail

DefaultServerUnsafeback to summary
private DefaultServerUnsafe()

Method Detail

connectback to summary
public void connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)

Implements io.netty.channel.Channel.Unsafe.connect.

Doc from io.netty.channel.Channel.Unsafe.connect.

Connect the Channel of the given ChannelFuture with the given remote SocketAddress. If a specific local SocketAddress should be used it need to be given as argument. Otherwise just pass null to it. The ChannelPromise will get notified once the connect operation was complete.

Annotations
@Override