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

public Class Socks5ServerEncoder

extends MessageToByteEncoder<Socks5Message>
Class Inheritance
Annotations
@Sharable
Imports
io.netty.buffer.ByteBuf, .ByteBufUtil, io.netty.channel.ChannelHandler.Sharable, .ChannelHandlerContext, io.netty.handler.codec.EncoderException, .MessageToByteEncoder, io.netty.util.internal.ObjectUtil, .StringUtil

Encodes a server-side Socks5Message into a ByteBuf.

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 void
encode(ChannelHandlerContext ctx, Socks5Message
the message to encode
msg
,
ByteBuf
the ByteBuf into which the encoded message will be written
out
)

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

Encode a message into a ByteBuf.
private static void
private void
private static void
Inherited from io.netty.handler.codec.MessageToByteEncoder:
acceptOutboundMessageallocateBufferisPreferDirectwrite

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.

encodeback to summary
protected void encode(ChannelHandlerContext ctx, Socks5Message msg, ByteBuf out) throws Exception

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

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

Encode a message into a ByteBuf. 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:ByteBuf

the ByteBuf 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, ByteBuf out)
encodeCommandResponseback to summary
private void encodeCommandResponse(Socks5CommandResponse msg, ByteBuf out) throws Exception
encodePasswordAuthResponseback to summary
private static void encodePasswordAuthResponse(Socks5PasswordAuthResponse msg, ByteBuf out)