public class NioUdtByteAcceptorChannel extends NioUdtAcceptorChannel
AbstractNioChannel.AbstractNioUnsafe, AbstractNioChannel.NioUnsafe
AbstractChannel.AbstractUnsafe
Channel.Unsafe
logger
readInterestOp
flushFutureNotifier
Constructor and Description |
---|
NioUdtByteAcceptorChannel() |
Modifier and Type | Method and Description |
---|---|
ByteBufAllocator |
alloc()
Return the assigned
ByteBufAllocator which will be used for allocate ByteBuf s. |
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. |
ChannelFuture |
close()
Request to close this ChannelOutboundInvoker 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 this ChannelOutboundInvoker and notify the
ChannelFuture once the operation completes,
either because the operation was successful or because of
an error. |
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 this ChannelOutboundInvoker 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 this ChannelOutboundInvoker 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 discconect 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 discconect from the remote peer and notify the
ChannelFuture once the operation completes,
either because the operation was successful or because of an error. |
protected int |
doReadMessages(MessageBuf<Object> buf)
Read messages into the given
MessageBuf and return the amount. |
ChannelFuture |
flush()
Request to flush all pending data which belongs to this ChannelOutboundInvoker and notify the
ChannelFuture once the operation completes, either because the operation was successful or because of
an error. |
ChannelFuture |
flush(ChannelPromise promise)
Request to flush all pending data which belongs to this ChannelOutboundInvoker and notify the
ChannelFuture once the operation completes, either because the operation was successful or because of
an error. |
ChannelMetadata |
metadata()
|
ChannelFuture |
newFailedFuture(Throwable cause)
Create a new
Future which is marked as fakued already. |
ChannelPromise |
newPromise()
Return a new
Promise . |
ChannelFuture |
newSucceededFuture()
Create a new
Future which is marked as successes already. |
ChannelPipeline |
pipeline()
Return the assigned
ChannelPipeline |
void |
read()
Request to Read data from the
Channel into the first inbound buffer, triggers an
inboundBufferUpdated event if data was
read, and triggers an
channelReadSuspended event so the
handler can decide to continue reading. |
ChannelFuture |
sendFile(FileRegion region)
Request to send a
FileRegion via this ChannelOutboundInvoker and notify the ChannelFuture
once the operation completes, either because the operation was successful or because of an error. |
ChannelFuture |
sendFile(FileRegion region,
ChannelPromise promise)
Request to send a
FileRegion via this ChannelOutboundInvoker and notify the ChannelFuture
once the operation completes, either because the operation was successful or because of an error. |
ChannelFuture |
write(Object message)
Request to write a message via this ChannelOutboundInvoker and notify the
ChannelFuture
once the operation completes, either because the operation was successful or because of an error. |
ChannelFuture |
write(Object message,
ChannelPromise promise)
Request to write a message via this ChannelOutboundInvoker and notify the
ChannelFuture
once the operation completes, either because the operation was successful or because of an error. |
config, doBind, doClose, doConnect, doDisconnect, doFinishConnect, doWriteMessages, isActive, javaChannel, localAddress, localAddress0, remoteAddress, remoteAddress0
doFlushMessageBuffer, newUnsafe
doBeginRead, doDeregister, doRegister, eventLoop, isCompatible, isFlushPending, isInputShutdown, isOpen, selectionKey, unsafe
alloc, bind, bind, checkEOF, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doFlushByteBuffer, doFlushFileRegion, doPreClose, equals, expandReadBuffer, flush, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, newFailedFuture, newPromise, newSucceededFuture, outboundByteBuffer, outboundMessageBuffer, parent, pipeline, read, sendFile, sendFile, toString, write, write
attr
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
closeFuture, eventLoop, id, isOpen, isRegistered, outboundByteBuffer, outboundMessageBuffer, parent, unsafe
attr
compareTo
protected int doReadMessages(MessageBuf<Object> buf) throws Exception
AbstractNioMessageChannel
MessageBuf
and return the amount.doReadMessages
in class AbstractNioMessageChannel
Exception
public ChannelMetadata metadata()
Channel
public ChannelFuture bind(SocketAddress localAddress)
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
ChannelOperationHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method
called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture connect(SocketAddress remoteAddress)
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
ChannelOperationHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress)
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
ChannelOperationHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture disconnect()
ChannelFuture
once the operation completes,
either because the operation was successful or because of an error.
This will result in having the
ChannelOperationHandler.disconnect(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture close()
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
ChannelOperationHandler.close(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture deregister()
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
ChannelOperationHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture flush()
ChannelFuture
once the operation completes, either because the operation was successful or because of
an error.
Be aware that the flush could be only partially successful. In such cases the ChannelFuture
will be
failed with an IncompleteFlushException
. So if you are interested to know if it was partial successful
you need to check if the returned Future.cause()
returns an instance of
IncompleteFlushException
. In such cases you may want to call flush(ChannelPromise)
or
flush()
to flush the rest of the data or just close the connection via close(ChannelPromise)
or
close()
if it is not possible to recover.
This will result in having the
ChannelOperationHandler.flush(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture write(Object message)
ChannelFuture
once the operation completes, either because the operation was successful or because of an error.
If you want to write a FileRegion
use sendFile(FileRegion)
.
Be aware that the write could be only partially successful as the message may need to get encoded before write it
to the remote peer. In such cases the ChannelFuture
will be failed with a
IncompleteFlushException
. In such cases you may want to call flush(ChannelPromise)
or
flush()
to flush the rest of the data or just close the connection via close(ChannelPromise)
or close()
if it is not possible to recover.
This will result in having the message added to the outbound buffer of the next ChannelOutboundHandler
and the ChannelOperationHandler.flush(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture sendFile(FileRegion region)
FileRegion
via this ChannelOutboundInvoker 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
ChannelOperationHandler.sendFile(ChannelHandlerContext, FileRegion, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise)
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
ChannelOperationHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method
called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise)
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
ChannelOperationHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)
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
ChannelOperationHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture disconnect(ChannelPromise promise)
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
ChannelOperationHandler.disconnect(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture close(ChannelPromise promise)
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
ChannelOperationHandler.close(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture deregister(ChannelPromise promise)
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
ChannelOperationHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public void read()
Channel
into the first inbound buffer, triggers an
inboundBufferUpdated
event if data was
read, and triggers an
channelReadSuspended
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
ChannelOperationHandler.read(ChannelHandlerContext)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture flush(ChannelPromise promise)
ChannelFuture
once the operation completes, either because the operation was successful or because of
an error.
Be aware that the flush could be only partially successful. In such cases the ChannelFuture
will be
failed with an IncompleteFlushException
. So if you are interested to know if it was partial successful
you need to check if the returned Future.cause()
returns an instance of
IncompleteFlushException
. In such cases you may want to call flush(ChannelPromise)
or
flush()
to flush the rest of the data or just close the connection via close(ChannelPromise)
or
close()
if it is not possible to recover.
The given ChannelPromise
will be notified.
This will result in having the
ChannelOperationHandler.flush(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture write(Object message, ChannelPromise promise)
ChannelFuture
once the operation completes, either because the operation was successful or because of an error.
If you want to write a FileRegion
use sendFile(FileRegion)
.
Be aware that the write could be only partially successful as the message may need to get encoded before write it
to the remote peer. In such cases the ChannelFuture
will be failed with a
IncompleteFlushException
. In such cases you may want to call flush(ChannelPromise)
or
flush()
to flush the rest of the data or just close the connection via close(ChannelPromise)
or close()
if it is not possible to recover.
The given ChannelPromise
will be notified.
This will result in having the message added to the outbound buffer of the next ChannelOutboundHandler
and the ChannelOperationHandler.flush(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelFuture sendFile(FileRegion region, ChannelPromise promise)
FileRegion
via this ChannelOutboundInvoker 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
ChannelOperationHandler.sendFile(ChannelHandlerContext, FileRegion, ChannelPromise)
method called of the next ChannelOperationHandler
contained in the ChannelPipeline
of the
Channel
.
public ChannelPipeline pipeline()
ChannelPipeline
public ByteBufAllocator alloc()
ByteBufAllocator
which will be used for allocate ByteBuf
s.public ChannelPromise newPromise()
FutureFactory
Promise
.newPromise
in interface FutureFactory
public ChannelFuture newSucceededFuture()
FutureFactory
Future
which is marked as successes already. So Future.isSuccess()
will return true
. All FutureListener
added to it will be notified directly. Also
every call of blocking methods will just return without blocking.newSucceededFuture
in interface FutureFactory
public ChannelFuture newFailedFuture(Throwable cause)
FutureFactory
Future
which is marked as fakued already. So Future.isSuccess()
will return false
. All FutureListener
added to it will be notified directly. Also
every call of blocking methods will just return without blocking.newFailedFuture
in interface FutureFactory
Copyright © 2008-2013 The Netty Project. All Rights Reserved.