Top Description Fields Constructors Methods
io.netty.contrib.handler.codec.socksx.v5

public Class Socks5ServerEncoder

extends MessageToByteEncoder<Socks5Message>
Class Inheritance
Imports
io.netty5.buffer.Buffer, io.netty5.channel.ChannelHandlerContext, io.netty5.handler.codec.EncoderException, .MessageToByteEncoder, io.netty5.util.internal.StringUtil

Encodes a server-side Socks5Message into a Buffer.

Field Summary

Modifier and TypeField and Description
private final Socks5AddressEncoder
public static final Socks5ServerEncoder

Constructor Summary

AccessConstructor and Description
protected
Socks5ServerEncoder()

Creates a new instance with the default Socks5AddressEncoder.

public
Socks5ServerEncoder(Socks5AddressEncoder addressEncoder)

Creates a new instance with the specified Socks5AddressEncoder.

Method Summary

Modifier and TypeMethod and Description
protected final Socks5AddressEncoder
addressEncoder()

Returns the Socks5AddressEncoder of this encoder.

protected Buffer
allocateBuffer(ChannelHandlerContext ctx, Socks5Message
the message to be encoded
msg
)

Implements abstract io.netty5.handler.codec.MessageToByteEncoder.allocateBuffer.

Allocate a Buffer which will be used as argument of encode(ChannelHandlerContext, I, Buffer).
protected void
encode(ChannelHandlerContext ctx, Socks5Message
the message to encode
msg
,
Buffer
the Buffer into which the encoded message will be written
out
)

Implements abstract io.netty5.handler.codec.MessageToByteEncoder.encode.

Encode a message into a Buffer.
private static void
private void
private static void
public boolean
isSharable()

Overrides default io.netty5.channel.ChannelHandler.isSharable.

Returns true if this handler is sharable and thus can be added to more than one ChannelPipeline.
Inherited from io.netty5.handler.codec.MessageToByteEncoder:
acceptOutboundMessagewrite

Field Detail

addressEncoderback to summary
private final Socks5AddressEncoder addressEncoder
DEFAULTback to summary
public static final Socks5ServerEncoder DEFAULT

Constructor Detail

Socks5ServerEncoderback to summary
protected Socks5ServerEncoder()

Creates a new instance with the default Socks5AddressEncoder.

Socks5ServerEncoderback to summary
public Socks5ServerEncoder(Socks5AddressEncoder addressEncoder)

Creates a new instance with the specified Socks5AddressEncoder.

Method Detail

addressEncoderback to summary
protected final Socks5AddressEncoder addressEncoder()

Returns the Socks5AddressEncoder of this encoder.

allocateBufferback to summary
protected Buffer allocateBuffer(ChannelHandlerContext ctx, Socks5Message msg)

Implements abstract io.netty5.handler.codec.MessageToByteEncoder.allocateBuffer.

Doc from io.netty5.handler.codec.MessageToByteEncoder.allocateBuffer.

Allocate a Buffer which will be used as argument of encode(ChannelHandlerContext, I, Buffer).

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this MessageToByteEncoder belongs to

msg:Socks5Message

the message to be encoded

Annotations
@Override
encodeback to summary
protected void encode(ChannelHandlerContext ctx, Socks5Message msg, Buffer out) throws Exception

Implements abstract io.netty5.handler.codec.MessageToByteEncoder.encode.

Doc from io.netty5.handler.codec.MessageToByteEncoder.encode.

Encode a message into a Buffer. This method will be called for each written message that can be handled by this encoder.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this MessageToByteEncoder belongs to

msg:Socks5Message

the message to encode

out:Buffer

the Buffer into which the encoded message will be written

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
encodeAuthMethodResponseback to summary
private static void encodeAuthMethodResponse(Socks5InitialResponse msg, Buffer out)
encodeCommandResponseback to summary
private void encodeCommandResponse(Socks5CommandResponse msg, Buffer out) throws Exception
encodePasswordAuthResponseback to summary
private static void encodePasswordAuthResponse(Socks5PasswordAuthResponse msg, Buffer out)
isSharableback to summary
public boolean isSharable()

Overrides default io.netty5.channel.ChannelHandler.isSharable.

Doc from io.netty5.channel.ChannelHandler.isSharable.

Returns true if this handler is sharable and thus can be added to more than one ChannelPipeline. By default, this method returns false. If this method returns false, you have to create a new handler instance every time you add it to a pipeline because it has unshared state such as member variables.

Annotations
@Override