public class EmbeddedChannel extends AbstractChannel
Channel
implementations that are used in an embedded fashion.AbstractChannel.AbstractUnsafe
Channel.Unsafe
Constructor and Description |
---|
EmbeddedChannel()
Create a new instance with an
EmbeddedChannelId and an empty pipeline. |
EmbeddedChannel(boolean register,
boolean hasDisconnect,
ChannelHandler... handlers)
Create a new instance with the pipeline initialized with the specified handlers.
|
EmbeddedChannel(boolean hasDisconnect,
ChannelHandler... handlers)
Create a new instance with the pipeline initialized with the specified handlers.
|
EmbeddedChannel(Channel parent,
ChannelId channelId,
boolean register,
boolean hasDisconnect,
ChannelHandler... handlers)
Create a new instance with the channel ID set to the given ID and the pipeline
initialized with the specified handlers.
|
EmbeddedChannel(ChannelHandler... handlers)
Create a new instance with the pipeline initialized with the specified handlers.
|
EmbeddedChannel(ChannelId channelId)
Create a new instance with the specified ID and an empty pipeline.
|
EmbeddedChannel(ChannelId channelId,
boolean register,
boolean hasDisconnect,
ChannelHandler... handlers)
Create a new instance with the channel ID set to the given ID and the pipeline
initialized with the specified handlers.
|
EmbeddedChannel(ChannelId channelId,
boolean hasDisconnect,
ChannelConfig config,
ChannelHandler... handlers)
Create a new instance with the channel ID set to the given ID and the pipeline
initialized with the specified handlers.
|
EmbeddedChannel(ChannelId channelId,
boolean hasDisconnect,
ChannelHandler... handlers)
Create a new instance with the channel ID set to the given ID and the pipeline
initialized with the specified handlers.
|
EmbeddedChannel(ChannelId channelId,
ChannelHandler... handlers)
Create a new instance with the channel ID set to the given ID and the pipeline
initialized with the specified handlers.
|
Modifier and Type | Method and Description |
---|---|
void |
advanceTimeBy(long duration,
TimeUnit unit)
Advance the clock of the event loop of this channel by the given duration.
|
ChannelFuture |
bind(SocketAddress localAddress)
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. |
ChannelFuture |
bind(SocketAddress localAddress,
ChannelPromise promise)
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. |
void |
checkException()
Check if there was any
Throwable received and if so rethrow it. |
ChannelFuture |
close()
Request to close the
Channel and notify the ChannelFuture once the operation completes,
either because the operation was successful or because of
an error. |
ChannelFuture |
close(ChannelPromise promise)
Request to close the
Channel and notify the ChannelFuture once the operation completes,
either because the operation was successful or because of
an error. |
ChannelConfig |
config()
Returns the configuration of this channel.
|
ChannelFuture |
connect(SocketAddress remoteAddress)
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. |
ChannelFuture |
connect(SocketAddress remoteAddress,
ChannelPromise promise)
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. |
ChannelFuture |
connect(SocketAddress remoteAddress,
SocketAddress localAddress)
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. |
ChannelFuture |
connect(SocketAddress remoteAddress,
SocketAddress localAddress,
ChannelPromise promise)
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. |
ChannelFuture |
deregister()
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. |
ChannelFuture |
deregister(ChannelPromise promise)
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. |
ChannelFuture |
disconnect()
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. |
ChannelFuture |
disconnect(ChannelPromise promise)
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. |
protected void |
doBeginRead()
Schedule a read operation.
|
protected void |
doBind(SocketAddress localAddress)
Bind the
Channel to the SocketAddress |
protected void |
doClose()
Close the
Channel |
protected void |
doDisconnect()
Disconnect this
Channel from its remote peer |
protected void |
doRegister()
|
protected void |
doWrite(ChannelOutboundBuffer in)
Flush the content of the given buffer to the remote peer.
|
protected void |
ensureOpen()
Ensure the
Channel is open and if not throw an exception. |
boolean |
finish()
Mark this
Channel as finished. |
boolean |
finishAndReleaseAll()
Mark this
Channel as finished and release all pending message in the inbound and outbound buffer. |
Channel |
flush()
Request to flush all pending messages via this ChannelOutboundInvoker.
|
EmbeddedChannel |
flushInbound()
Flushes the inbound of this
Channel . |
EmbeddedChannel |
flushOutbound()
Flushes the outbound of this
Channel . |
void |
freezeTime()
Freeze the clock of this channel's event loop.
|
protected void |
handleInboundMessage(Object msg)
Called for each inbound message.
|
protected void |
handleOutboundMessage(Object msg)
Called for each outbound message.
|
boolean |
hasPendingTasks()
Check whether this channel has any pending tasks that would be executed by a call to
runPendingTasks() . |
Queue<Object> |
inboundMessages()
|
boolean |
isActive()
Return
true if the Channel is active and so connected. |
protected boolean |
isCompatible(EventLoop loop)
Return
true if the given EventLoop is compatible with this instance. |
boolean |
isOpen()
Returns
true if the Channel is open and may get active later |
Queue<Object> |
lastInboundBuffer()
Deprecated.
|
Queue<Object> |
lastOutboundBuffer()
Deprecated.
|
protected SocketAddress |
localAddress0()
Returns the
SocketAddress which is bound locally. |
ChannelMetadata |
metadata()
|
protected DefaultChannelPipeline |
newChannelPipeline()
Returns a new
DefaultChannelPipeline instance. |
protected AbstractChannel.AbstractUnsafe |
newUnsafe()
Create a new
AbstractChannel.AbstractUnsafe instance which will be used for the life-time of the Channel |
Queue<Object> |
outboundMessages()
|
Channel |
read()
Request to Read data from the
Channel into the first inbound buffer, triggers an
ChannelInboundHandler.channelRead(ChannelHandlerContext, Object) event if data was
read, and triggers a
channelReadComplete event so the
handler can decide to continue reading. |
<T> T |
readInbound()
Return received data from this
Channel |
<T> T |
readOutbound()
Read data from the outbound.
|
void |
register()
Register this
Channel on its EventLoop . |
boolean |
releaseInbound()
Release all buffered inbound messages and return
true if any were in the inbound buffer, false
otherwise. |
boolean |
releaseOutbound()
Release all buffered outbound messages and return
true if any were in the outbound buffer, false
otherwise. |
protected SocketAddress |
remoteAddress0()
Return the
SocketAddress which the Channel is connected to. |
void |
runPendingTasks()
|
long |
runScheduledPendingTasks()
|
void |
unfreezeTime()
Unfreeze an event loop that was
frozen . |
Channel.Unsafe |
unsafe()
Returns an internal-use-only object that provides unsafe operations.
|
ChannelFuture |
write(Object msg)
Request to write a message via this
ChannelHandlerContext through the ChannelPipeline . |
ChannelFuture |
write(Object msg,
ChannelPromise promise)
Request to write a message via this
ChannelHandlerContext through the ChannelPipeline . |
ChannelFuture |
writeAndFlush(Object msg)
Shortcut for call
ChannelOutboundInvoker.write(Object) and ChannelOutboundInvoker.flush() . |
ChannelFuture |
writeAndFlush(Object msg,
ChannelPromise promise)
Shortcut for call
ChannelOutboundInvoker.write(Object, ChannelPromise) and ChannelOutboundInvoker.flush() . |
boolean |
writeInbound(Object... msgs)
Write messages to the inbound of this
Channel . |
ChannelFuture |
writeOneInbound(Object msg)
Writes one message to the inbound of this
Channel and does not flush it. |
ChannelFuture |
writeOneInbound(Object msg,
ChannelPromise promise)
Writes one message to the inbound of this
Channel and does not flush it. |
ChannelFuture |
writeOneOutbound(Object msg)
Writes one message to the outbound of this
Channel and does not flush it. |
ChannelFuture |
writeOneOutbound(Object msg,
ChannelPromise promise)
Writes one message to the outbound of this
Channel and does not flush it. |
boolean |
writeOutbound(Object... msgs)
Write messages to the outbound of this
Channel . |
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, compareTo, doDeregister, doShutdownOutput, equals, eventLoop, filterOutboundMessage, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, maxMessagesPerWrite, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, remoteAddress, toString, validateFileRegion, voidPromise
attr, hasAttr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
attr, hasAttr
public EmbeddedChannel()
EmbeddedChannelId
and an empty pipeline.public EmbeddedChannel(ChannelId channelId)
channelId
- the ChannelId
that will be used to identify this channelpublic EmbeddedChannel(ChannelHandler... handlers)
handlers
- the ChannelHandler
s which will be add in the ChannelPipeline
public EmbeddedChannel(boolean hasDisconnect, ChannelHandler... handlers)
hasDisconnect
- false
if this Channel
will delegate disconnect()
to close()
, true
otherwise.handlers
- the ChannelHandler
s which will be added to the ChannelPipeline
public EmbeddedChannel(boolean register, boolean hasDisconnect, ChannelHandler... handlers)
register
- true
if this Channel
is registered to the EventLoop
in the
constructor. If false
the user will need to call register()
.hasDisconnect
- false
if this Channel
will delegate disconnect()
to close()
, true
otherwise.handlers
- the ChannelHandler
s which will be added to the ChannelPipeline
public EmbeddedChannel(ChannelId channelId, ChannelHandler... handlers)
channelId
- the ChannelId
that will be used to identify this channelhandlers
- the ChannelHandler
s which will be added to the ChannelPipeline
public EmbeddedChannel(ChannelId channelId, boolean hasDisconnect, ChannelHandler... handlers)
channelId
- the ChannelId
that will be used to identify this channelhasDisconnect
- false
if this Channel
will delegate disconnect()
to close()
, true
otherwise.handlers
- the ChannelHandler
s which will be added to the ChannelPipeline
public EmbeddedChannel(ChannelId channelId, boolean register, boolean hasDisconnect, ChannelHandler... handlers)
channelId
- the ChannelId
that will be used to identify this channelregister
- true
if this Channel
is registered to the EventLoop
in the
constructor. If false
the user will need to call register()
.hasDisconnect
- false
if this Channel
will delegate disconnect()
to close()
, true
otherwise.handlers
- the ChannelHandler
s which will be added to the ChannelPipeline
public EmbeddedChannel(Channel parent, ChannelId channelId, boolean register, boolean hasDisconnect, ChannelHandler... handlers)
parent
- the parent Channel
of this EmbeddedChannel
.channelId
- the ChannelId
that will be used to identify this channelregister
- true
if this Channel
is registered to the EventLoop
in the
constructor. If false
the user will need to call register()
.hasDisconnect
- false
if this Channel
will delegate disconnect()
to close()
, true
otherwise.handlers
- the ChannelHandler
s which will be added to the ChannelPipeline
public EmbeddedChannel(ChannelId channelId, boolean hasDisconnect, ChannelConfig config, ChannelHandler... handlers)
channelId
- the ChannelId
that will be used to identify this channelhasDisconnect
- false
if this Channel
will delegate disconnect()
to close()
, true
otherwise.config
- the ChannelConfig
which will be returned by config()
.handlers
- the ChannelHandler
s which will be added to the ChannelPipeline
public void register() throws Exception
Channel
on its EventLoop
.Exception
protected final DefaultChannelPipeline newChannelPipeline()
AbstractChannel
DefaultChannelPipeline
instance.newChannelPipeline
in class AbstractChannel
public ChannelMetadata metadata()
Channel
public ChannelConfig config()
Channel
public boolean isOpen()
Channel
true
if the Channel
is open and may get active laterpublic boolean isActive()
Channel
true
if the Channel
is active and so connected.@Deprecated public Queue<Object> lastInboundBuffer()
inboundMessages()
@Deprecated public Queue<Object> lastOutboundBuffer()
outboundMessages()
public <T> T readInbound()
Channel
public <T> T readOutbound()
null
if nothing is readable.public boolean writeInbound(Object... msgs)
Channel
.msgs
- the messages to be writtentrue
if the write operation did add something to the inbound bufferpublic ChannelFuture writeOneInbound(Object msg)
Channel
and does not flush it. This
method is conceptually equivalent to write(Object)
.writeOneOutbound(Object)
public ChannelFuture writeOneInbound(Object msg, ChannelPromise promise)
Channel
and does not flush it. This
method is conceptually equivalent to write(Object, ChannelPromise)
.writeOneOutbound(Object, ChannelPromise)
public EmbeddedChannel flushInbound()
flushOutbound()
public boolean writeOutbound(Object... msgs)
Channel
.msgs
- the messages to be writtentrue
if the write operation did add something to the outbound bufferpublic ChannelFuture writeOneOutbound(Object msg)
Channel
and does not flush it. This
method is conceptually equivalent to write(Object)
.writeOneInbound(Object)
public ChannelFuture writeOneOutbound(Object msg, ChannelPromise promise)
Channel
and does not flush it. This
method is conceptually equivalent to write(Object, ChannelPromise)
.writeOneInbound(Object, ChannelPromise)
public EmbeddedChannel flushOutbound()
flushInbound()
public boolean finish()
Channel
as finished. Any further try to write data to it will fail.true
if any of the used buffers has something left to readpublic boolean finishAndReleaseAll()
Channel
as finished and release all pending message in the inbound and outbound buffer.
Any further try to write data to it will fail.true
if any of the used buffers has something left to readpublic boolean releaseInbound()
true
if any were in the inbound buffer, false
otherwise.public boolean releaseOutbound()
true
if any were in the outbound buffer, false
otherwise.public final ChannelFuture close()
ChannelOutboundInvoker
Channel
and notify the ChannelFuture
once the operation completes,
either because the operation was successful or because of
an error.
After it is closed it is not possible to reuse it again.
This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
close
in interface ChannelOutboundInvoker
close
in class AbstractChannel
public final ChannelFuture disconnect()
ChannelOutboundInvoker
ChannelFuture
once the operation completes,
either because the operation was successful or because of an error.
This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
disconnect
in interface ChannelOutboundInvoker
disconnect
in class AbstractChannel
public final ChannelFuture close(ChannelPromise promise)
ChannelOutboundInvoker
Channel
and notify the ChannelFuture
once the operation completes,
either because the operation was successful or because of
an error.
After it is closed it is not possible to reuse it again.
The given ChannelPromise
will be notified.
This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
close
in interface ChannelOutboundInvoker
close
in class AbstractChannel
public final ChannelFuture disconnect(ChannelPromise promise)
ChannelOutboundInvoker
ChannelFuture
once the operation completes,
either because the operation was successful or because of an error.
The given ChannelPromise
will be notified.
This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
disconnect
in interface ChannelOutboundInvoker
disconnect
in class AbstractChannel
public ChannelFuture bind(SocketAddress localAddress)
ChannelOutboundInvoker
SocketAddress
and notify the ChannelFuture
once the operation
completes, either because the operation was successful or because of an error.
This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method
called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
bind
in interface ChannelOutboundInvoker
bind
in class AbstractChannel
public ChannelFuture connect(SocketAddress remoteAddress)
ChannelOutboundInvoker
SocketAddress
and notify the ChannelFuture
once the operation
completes, either because the operation was successful or because of an error.
If the connection fails because of a connection timeout, the ChannelFuture
will get failed with
a ConnectTimeoutException
. If it fails because of connection refused a ConnectException
will be used.
This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
connect
in interface ChannelOutboundInvoker
connect
in class AbstractChannel
public ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress)
ChannelOutboundInvoker
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.
This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
connect
in interface ChannelOutboundInvoker
connect
in class AbstractChannel
public ChannelFuture deregister()
ChannelOutboundInvoker
EventExecutor
and notify the
ChannelFuture
once the operation completes, either because the operation was successful or because of
an error.
This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
deregister
in interface ChannelOutboundInvoker
deregister
in class AbstractChannel
public Channel flush()
ChannelOutboundInvoker
flush
in interface Channel
flush
in interface ChannelOutboundInvoker
flush
in class AbstractChannel
public ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise)
ChannelOutboundInvoker
SocketAddress
and notify the ChannelFuture
once the operation
completes, either because the operation was successful or because of an error.
The given ChannelPromise
will be notified.
This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method
called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
bind
in interface ChannelOutboundInvoker
bind
in class AbstractChannel
public ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise)
ChannelOutboundInvoker
SocketAddress
and notify the ChannelFuture
once the operation
completes, either because the operation was successful or because of an error.
The given ChannelFuture
will be notified.
If the connection fails because of a connection timeout, the ChannelFuture
will get failed with
a ConnectTimeoutException
. If it fails because of connection refused a ConnectException
will be used.
This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
connect
in interface ChannelOutboundInvoker
connect
in class AbstractChannel
public ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)
ChannelOutboundInvoker
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.
The given ChannelPromise
will be notified and also returned.
This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
connect
in interface ChannelOutboundInvoker
connect
in class AbstractChannel
public ChannelFuture deregister(ChannelPromise promise)
ChannelOutboundInvoker
EventExecutor
and notify the
ChannelFuture
once the operation completes, either because the operation was successful or because of
an error.
The given ChannelPromise
will be notified.
This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
deregister
in interface ChannelOutboundInvoker
deregister
in class AbstractChannel
public Channel read()
ChannelOutboundInvoker
Channel
into the first inbound buffer, triggers an
ChannelInboundHandler.channelRead(ChannelHandlerContext, Object)
event if data was
read, and triggers a
channelReadComplete
event so the
handler can decide to continue reading. If there's a pending read operation already, this method does nothing.
This will result in having the
ChannelOutboundHandler.read(ChannelHandlerContext)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
read
in interface Channel
read
in interface ChannelOutboundInvoker
read
in class AbstractChannel
public ChannelFuture write(Object msg)
ChannelOutboundInvoker
ChannelHandlerContext
through the ChannelPipeline
.
This method will not request to actual flush, so be sure to call ChannelOutboundInvoker.flush()
once you want to request to flush all pending data to the actual transport.write
in interface ChannelOutboundInvoker
write
in class AbstractChannel
public ChannelFuture write(Object msg, ChannelPromise promise)
ChannelOutboundInvoker
ChannelHandlerContext
through the ChannelPipeline
.
This method will not request to actual flush, so be sure to call ChannelOutboundInvoker.flush()
once you want to request to flush all pending data to the actual transport.write
in interface ChannelOutboundInvoker
write
in class AbstractChannel
public ChannelFuture writeAndFlush(Object msg)
ChannelOutboundInvoker
ChannelOutboundInvoker.write(Object)
and ChannelOutboundInvoker.flush()
.writeAndFlush
in interface ChannelOutboundInvoker
writeAndFlush
in class AbstractChannel
public ChannelFuture writeAndFlush(Object msg, ChannelPromise promise)
ChannelOutboundInvoker
ChannelOutboundInvoker.write(Object, ChannelPromise)
and ChannelOutboundInvoker.flush()
.writeAndFlush
in interface ChannelOutboundInvoker
writeAndFlush
in class AbstractChannel
public void runPendingTasks()
public boolean hasPendingTasks()
runPendingTasks()
.
This includes normal tasks, and scheduled tasks where the deadline has expired. If this method returns
false
, a call to runPendingTasks()
would do nothing.true
if there are any pending tasks, false
otherwise.public long runScheduledPendingTasks()
public void advanceTimeBy(long duration, TimeUnit unit)
runScheduledPendingTasks()
still needs to be called).public void freezeTime()
runScheduledPendingTasks()
calls. While the event loop is frozen, it is still possible to
advance time
manually so that scheduled tasks execute.public void unfreezeTime()
frozen
. Time will continue at the point where
freezeTime()
stopped it: if a task was scheduled ten minutes in the future and freezeTime()
was called, it will run ten minutes after this method is called again (assuming no
advanceTimeBy(long, TimeUnit)
calls, and assuming pending scheduled tasks are run at that time using
runScheduledPendingTasks()
).public void checkException()
Throwable
received and if so rethrow it.protected final void ensureOpen()
Channel
is open and if not throw an exception.protected boolean isCompatible(EventLoop loop)
AbstractChannel
true
if the given EventLoop
is compatible with this instance.isCompatible
in class AbstractChannel
protected SocketAddress localAddress0()
AbstractChannel
SocketAddress
which is bound locally.localAddress0
in class AbstractChannel
protected SocketAddress remoteAddress0()
AbstractChannel
SocketAddress
which the Channel
is connected to.remoteAddress0
in class AbstractChannel
protected void doRegister() throws Exception
AbstractChannel
Channel
is registered with its EventLoop
as part of the register process.
Sub-classes may override this methoddoRegister
in class AbstractChannel
Exception
protected void doBind(SocketAddress localAddress) throws Exception
AbstractChannel
Channel
to the SocketAddress
doBind
in class AbstractChannel
Exception
protected void doDisconnect() throws Exception
AbstractChannel
Channel
from its remote peerdoDisconnect
in class AbstractChannel
Exception
protected void doClose() throws Exception
AbstractChannel
Channel
doClose
in class AbstractChannel
Exception
protected void doBeginRead() throws Exception
AbstractChannel
doBeginRead
in class AbstractChannel
Exception
protected AbstractChannel.AbstractUnsafe newUnsafe()
AbstractChannel
AbstractChannel.AbstractUnsafe
instance which will be used for the life-time of the Channel
newUnsafe
in class AbstractChannel
public Channel.Unsafe unsafe()
Channel
unsafe
in interface Channel
unsafe
in class AbstractChannel
protected void doWrite(ChannelOutboundBuffer in) throws Exception
AbstractChannel
doWrite
in class AbstractChannel
Exception
protected void handleOutboundMessage(Object msg)
doWrite(ChannelOutboundBuffer)
protected void handleInboundMessage(Object msg)
Copyright © 2008–2024 The Netty Project. All rights reserved.