Package io.netty.channel
Class AbstractServerChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
io.netty.channel.AbstractServerChannel
- All Implemented Interfaces:
Channel
,ChannelOutboundInvoker
,ServerChannel
,AttributeMap
,Comparable<Channel>
- Direct Known Subclasses:
LocalServerChannel
A skeletal server-side
Channel
implementation. A server-side
Channel
does not allow the following operations:
AbstractChannel.connect(SocketAddress, ChannelPromise)
AbstractChannel.disconnect(ChannelPromise)
AbstractChannel.write(Object, ChannelPromise)
AbstractChannel.flush()
- and the shortcut methods which calls the methods mentioned above
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.netty.channel.AbstractChannel
AbstractChannel.AbstractUnsafe, AbstractChannel.CloseFuture
Nested classes/interfaces inherited from interface io.netty.channel.Channel
Channel.Unsafe
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Disconnect thisChannel
from its remote peerprotected void
Flush the content of the given buffer to the remote peer.protected final Object
Invoked when a new message is added to aChannelOutboundBuffer
of thisAbstractChannel
, so that theChannel
implementation converts the message to another.metadata()
protected AbstractChannel.AbstractUnsafe
Create a newAbstractChannel.AbstractUnsafe
instance which will be used for the life-time of theChannel
Returns the remote address where this channel is connected to.protected SocketAddress
Return theSocketAddress
which theChannel
is connected to.Methods inherited from class io.netty.channel.AbstractChannel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doBeginRead, doBind, doClose, doDeregister, doRegister, doShutdownOutput, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isCompatible, isRegistered, isWritable, localAddress, localAddress0, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, toString, unsafe, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlush
Methods inherited from class io.netty.util.DefaultAttributeMap
attr, hasAttr
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.netty.util.AttributeMap
attr, hasAttr
Methods inherited from interface io.netty.channel.Channel
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, config, eventLoop, flush, id, isActive, isOpen, isRegistered, isWritable, localAddress, parent, pipeline, read, unsafe
Methods inherited from interface io.netty.channel.ChannelOutboundInvoker
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlush
Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
METADATA
-
-
Constructor Details
-
AbstractServerChannel
protected AbstractServerChannel()Creates a new instance.
-
-
Method Details
-
metadata
Description copied from interface:Channel
-
remoteAddress
Description copied from interface:Channel
Returns the remote address where this channel is connected to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Specified by:
remoteAddress
in interfaceChannel
- Overrides:
remoteAddress
in classAbstractChannel
- Returns:
- 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
, useDefaultAddressedEnvelope.recipient()
to determine the origination of the received message as this method will returnnull
.
-
remoteAddress0
Description copied from class:AbstractChannel
Return theSocketAddress
which theChannel
is connected to.- Specified by:
remoteAddress0
in classAbstractChannel
-
doDisconnect
Description copied from class:AbstractChannel
Disconnect thisChannel
from its remote peer- Specified by:
doDisconnect
in classAbstractChannel
- Throws:
Exception
-
newUnsafe
Description copied from class:AbstractChannel
Create a newAbstractChannel.AbstractUnsafe
instance which will be used for the life-time of theChannel
- Specified by:
newUnsafe
in classAbstractChannel
-
doWrite
Description copied from class:AbstractChannel
Flush the content of the given buffer to the remote peer.- Specified by:
doWrite
in classAbstractChannel
- Throws:
Exception
-
filterOutboundMessage
Description copied from class:AbstractChannel
Invoked when a new message is added to aChannelOutboundBuffer
of thisAbstractChannel
, so that theChannel
implementation converts the message to another. (e.g. heap buffer -> direct buffer)- Overrides:
filterOutboundMessage
in classAbstractChannel
-