@ChannelHandler.Sharable public class ResolveAddressHandler extends ChannelOutboundHandlerAdapter
ChannelOutboundHandlerAdapter
which will resolve the SocketAddress
that is passed to
connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
if it is not already resolved
and the AddressResolver
supports the type of SocketAddress
.ChannelHandler.Sharable
构造器和说明 |
---|
ResolveAddressHandler(AddressResolverGroup<? extends java.net.SocketAddress> resolverGroup) |
限定符和类型 | 方法和说明 |
---|---|
void |
connect(ChannelHandlerContext ctx,
java.net.SocketAddress remoteAddress,
java.net.SocketAddress localAddress,
ChannelPromise promise)
Calls
ChannelOutboundInvoker.connect(SocketAddress, SocketAddress, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline . |
bind, close, deregister, disconnect, flush, read, write
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public ResolveAddressHandler(AddressResolverGroup<? extends java.net.SocketAddress> resolverGroup)
public void connect(ChannelHandlerContext ctx, java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)
ChannelOutboundHandlerAdapter
ChannelOutboundInvoker.connect(SocketAddress, SocketAddress, ChannelPromise)
to forward
to the next ChannelOutboundHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.connect
在接口中 ChannelOutboundHandler
connect
在类中 ChannelOutboundHandlerAdapter
ctx
- the ChannelHandlerContext
for which the connect operation is maderemoteAddress
- the SocketAddress
to which it should connectlocalAddress
- the SocketAddress
which is used as source on connectpromise
- the ChannelPromise
to notify once the operation completes