Interface ChannelOutboundInvoker
- All Known Subinterfaces:
Channel, ChannelHandlerContext, ChannelPipeline, DatagramChannel, DomainDatagramChannel, DomainSocketChannel, DuplexChannel, Http2StreamChannel, QuicChannel, QuicStreamChannel, SctpChannel, SctpServerChannel, ServerChannel, ServerDomainSocketChannel, ServerSocketChannel, SocketChannel, UdtChannel, UdtServerChannel, UnixChannel
- All Known Implementing Classes:
AbstractChannel, AbstractEpollServerChannel, AbstractEpollStreamChannel, AbstractKQueueServerChannel, AbstractKQueueStreamChannel, AbstractNioByteChannel, AbstractNioChannel, AbstractNioMessageChannel, AbstractOioByteChannel, AbstractOioChannel, AbstractOioMessageChannel, AbstractServerChannel, DefaultChannelPipeline, EmbeddedChannel, EpollDatagramChannel, EpollDomainDatagramChannel, EpollDomainSocketChannel, EpollServerDomainSocketChannel, EpollServerSocketChannel, EpollSocketChannel, IoUringDatagramChannel, IoUringDomainSocketChannel, IoUringServerDomainSocketChannel, IoUringServerSocketChannel, IoUringSocketChannel, KQueueDatagramChannel, KQueueDomainDatagramChannel, KQueueDomainSocketChannel, KQueueServerDomainSocketChannel, KQueueServerSocketChannel, KQueueSocketChannel, LocalChannel, LocalServerChannel, NioDatagramChannel, NioDomainSocketChannel, NioSctpChannel, NioSctpServerChannel, NioServerDomainSocketChannel, NioServerSocketChannel, NioSocketChannel, NioUdtAcceptorChannel, NioUdtByteAcceptorChannel, NioUdtByteConnectorChannel, NioUdtByteRendezvousChannel, NioUdtMessageAcceptorChannel, NioUdtMessageConnectorChannel, NioUdtMessageRendezvousChannel, OioByteStreamChannel, OioDatagramChannel, OioSctpChannel, OioSctpServerChannel, OioServerSocketChannel, OioSocketChannel, RxtxChannel
-
Method Summary
Modifier and TypeMethodDescriptiondefault ChannelFuturebind(SocketAddress localAddress) Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.bind(SocketAddress localAddress, ChannelPromise promise) Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureclose()Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.close(ChannelPromise promise) Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(SocketAddress remoteAddress) Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.connect(SocketAddress remoteAddress, ChannelPromise promise) Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(SocketAddress remoteAddress, SocketAddress localAddress) Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureRequest to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.deregister(ChannelPromise promise) Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureRequest to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.disconnect(ChannelPromise promise) Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.flush()Request to flush all pending messages via this ChannelOutboundInvoker.newFailedFuture(Throwable cause) Create a newChannelFuturewhich is marked as failed already.Return an newChannelProgressivePromiseReturn a newChannelPromise.Create a newChannelFuturewhich is marked as succeeded already.read()Request to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading.Return a special ChannelPromise which can be reused for different operations.default ChannelFutureRequest to write a message via thisChannelHandlerContextthrough theChannelPipeline.write(Object msg, ChannelPromise promise) Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.default ChannelFuturewriteAndFlush(Object msg) Shortcut for callwrite(Object)andflush().writeAndFlush(Object msg, ChannelPromise promise) Shortcut for callwrite(Object, ChannelPromise)andflush().
-
Method Details
-
bind
Request to bind to the givenSocketAddressand notify theChannelFutureonce 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 nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
connect
Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.If the connection fails because of a connection timeout, the
ChannelFuturewill get failed with aConnectTimeoutException. If it fails because of connection refused aConnectExceptionwill be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
connect
Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce 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 nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
disconnect
Request to disconnect from the remote peer and notify theChannelFutureonce 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 nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
close
Request to close theChanneland notify theChannelFutureonce 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 nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
deregister
Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce 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 nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
bind
Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
connect
Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelFuturewill be notified.If the connection fails because of a connection timeout, the
ChannelFuturewill get failed with aConnectTimeoutException. If it fails because of connection refused aConnectExceptionwill be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
connect
ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified and also returned.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
disconnect
Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
close
Request to close theChanneland notify theChannelFutureonce 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 givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
deregister
Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
read
ChannelOutboundInvoker read()Request to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent 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 nextChannelOutboundHandlercontained in theChannelPipelineof theChannel. -
write
Request to write a message via thisChannelHandlerContextthrough theChannelPipeline. This method will not request to actual flush, so be sure to callflush()once you want to request to flush all pending data to the actual transport. -
write
Request to write a message via thisChannelHandlerContextthrough theChannelPipeline. This method will not request to actual flush, so be sure to callflush()once you want to request to flush all pending data to the actual transport. -
flush
ChannelOutboundInvoker flush()Request to flush all pending messages via this ChannelOutboundInvoker. -
writeAndFlush
Shortcut for callwrite(Object, ChannelPromise)andflush(). -
writeAndFlush
Shortcut for callwrite(Object)andflush(). -
newPromise
ChannelPromise newPromise()Return a newChannelPromise. -
newProgressivePromise
ChannelProgressivePromise newProgressivePromise()Return an newChannelProgressivePromise -
newSucceededFuture
ChannelFuture newSucceededFuture()Create a newChannelFuturewhich is marked as succeeded already. SoFuture.isSuccess()will returntrue. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking. -
newFailedFuture
Create a newChannelFuturewhich is marked as failed already. SoFuture.isSuccess()will returnfalse. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking. -
voidPromise
ChannelPromise voidPromise()Return a special ChannelPromise which can be reused for different operations.It's only supported to use it for
write(Object, ChannelPromise).Be aware that the returned
Be aware this is an expert feature and should be used with care!ChannelPromisewill 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 callChannelPipeline.fireExceptionCaught(Throwable)in this case.
-