Class Socks5ClientEncoder
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToByteEncoder<Socks5Message>
io.netty.handler.codec.socksx.v5.Socks5ClientEncoder
- All Implemented Interfaces:
ChannelHandler, ChannelOutboundHandler
Encodes a client-side
Socks5Message into a ByteBuf.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.SharableModifier and TypeInterfaceDescriptionstatic @interfaceIndicates that the same instance of the annotatedChannelHandlercan be added to one or moreChannelPipelines multiple times without a race condition. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new instance with the defaultSocks5AddressEncoder.Socks5ClientEncoder(Socks5AddressEncoder addressEncoder) Creates a new instance with the specifiedSocks5AddressEncoder. -
Method Summary
Modifier and TypeMethodDescriptionprotected final Socks5AddressEncoderReturns theSocks5AddressEncoderof this encoder.protected voidencode(ChannelHandlerContext ctx, Socks5Message msg, ByteBuf out) Encode a message into aByteBuf.Methods inherited from class MessageToByteEncoder
acceptOutboundMessage, allocateBuffer, isPreferDirect, writeModifier and TypeMethodDescriptionbooleanReturnstrueif the given message should be handled.protected ByteBufallocateBuffer(ChannelHandlerContext ctx, Socks5Message msg, boolean preferDirect) Allocate aByteBufwhich will be used as argument ofMessageToByteEncoder.encode(ChannelHandlerContext, I, ByteBuf).protected booleanvoidwrite(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) CallsChannelOutboundInvoker.write(Object, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.Methods inherited from class ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, readModifier and TypeMethodDescriptionvoidbind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) CallsChannelOutboundInvoker.bind(SocketAddress, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidclose(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.close(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidconnect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) CallsChannelOutboundInvoker.connect(SocketAddress, SocketAddress, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidderegister(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.deregister(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voiddisconnect(ChannelHandlerContext ctx, ChannelPromise promise) CallsChannelOutboundInvoker.disconnect(ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.flush()to forward to the nextChannelOutboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.read()to forward to the nextChannelOutboundHandlerin theChannelPipeline.Methods inherited from class ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableModifier and TypeMethodDescriptionprotected voidvoidexceptionCaught(ChannelHandlerContext ctx, Throwable cause) Deprecated.voidDo nothing by default, sub-classes may override this method.voidDo nothing by default, sub-classes may override this method.booleanReturntrueif the implementation isChannelHandler.Sharableand so can be added to differentChannelPipelines.
-
Field Details
-
DEFAULT
-
-
Constructor Details
-
Socks5ClientEncoder
protected Socks5ClientEncoder()Creates a new instance with the defaultSocks5AddressEncoder. -
Socks5ClientEncoder
Creates a new instance with the specifiedSocks5AddressEncoder.
-
-
Method Details
-
addressEncoder
Returns theSocks5AddressEncoderof this encoder. -
encode
Description copied from class:MessageToByteEncoderEncode a message into aByteBuf. This method will be called for each written message that can be handled by this encoder.- Specified by:
encodein classMessageToByteEncoder<Socks5Message>- Parameters:
ctx- theChannelHandlerContextwhich thisMessageToByteEncoderbelongs tomsg- the message to encodeout- theByteBufinto which the encoded message will be written- Throws:
Exception- is thrown if an error occurs
-
ChannelInboundHandler