public interface ChannelOutboundInvoker
限定符和类型 | 方法和说明 |
---|---|
ChannelFuture |
bind(java.net.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(java.net.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 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. |
ChannelFuture |
connect(java.net.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(java.net.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(java.net.SocketAddress remoteAddress,
java.net.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(java.net.SocketAddress remoteAddress,
java.net.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. |
ChannelOutboundInvoker |
flush()
Request to flush all pending messages via this ChannelOutboundInvoker.
|
ChannelFuture |
newFailedFuture(java.lang.Throwable cause)
Create a new
ChannelFuture which is marked as failed already. |
ChannelProgressivePromise |
newProgressivePromise()
Return an new
ChannelProgressivePromise |
ChannelPromise |
newPromise()
Return a new
ChannelPromise . |
ChannelFuture |
newSucceededFuture()
Create a new
ChannelFuture which is marked as succeeded already. |
ChannelOutboundInvoker |
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. |
ChannelPromise |
voidPromise()
Return a special ChannelPromise which can be reused for different operations.
|
ChannelFuture |
write(java.lang.Object msg)
Request to write a message via this
ChannelHandlerContext through the ChannelPipeline . |
ChannelFuture |
write(java.lang.Object msg,
ChannelPromise promise)
Request to write a message via this
ChannelHandlerContext through the ChannelPipeline . |
ChannelFuture |
writeAndFlush(java.lang.Object msg)
Shortcut for call
write(Object) and flush() . |
ChannelFuture |
writeAndFlush(java.lang.Object msg,
ChannelPromise promise)
Shortcut for call
write(Object, ChannelPromise) and flush() . |
ChannelFuture bind(java.net.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
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method
called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
ChannelFuture connect(java.net.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
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.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
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
ChannelFuture disconnect()
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
.
ChannelFuture close()
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
.
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
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
ChannelFuture bind(java.net.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
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method
called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
ChannelFuture connect(java.net.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
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.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
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
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
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
ChannelFuture close(ChannelPromise promise)
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
.
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
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the next ChannelOutboundHandler
contained in the ChannelPipeline
of the
Channel
.
ChannelOutboundInvoker read()
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
.
ChannelFuture write(java.lang.Object msg)
ChannelHandlerContext
through the ChannelPipeline
.
This method will not request to actual flush, so be sure to call flush()
once you want to request to flush all pending data to the actual transport.ChannelFuture write(java.lang.Object msg, ChannelPromise promise)
ChannelHandlerContext
through the ChannelPipeline
.
This method will not request to actual flush, so be sure to call flush()
once you want to request to flush all pending data to the actual transport.ChannelOutboundInvoker flush()
ChannelFuture writeAndFlush(java.lang.Object msg, ChannelPromise promise)
write(Object, ChannelPromise)
and flush()
.ChannelFuture writeAndFlush(java.lang.Object msg)
write(Object)
and flush()
.ChannelPromise newPromise()
ChannelPromise
.ChannelProgressivePromise newProgressivePromise()
ChannelProgressivePromise
ChannelFuture newSucceededFuture()
ChannelFuture
which is marked as succeeded 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.ChannelFuture newFailedFuture(java.lang.Throwable cause)
ChannelFuture
which is marked as failed 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.ChannelPromise voidPromise()
It's only supported to use
it for write(Object, ChannelPromise)
.
Be aware that the returned ChannelPromise
will not support most operations and should only be used
if you want to save an object allocation for every write operation. You will not be able to detect if the
operation was complete, only if it failed as the implementation will call
ChannelPipeline.fireExceptionCaught(Throwable)
in this case.