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

public Class SocksPortUnificationServerHandler

extends ByteToMessageDecoder
Class Inheritance
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelHandlerContext, .ChannelPipeline, io.netty.handler.codec.ByteToMessageDecoder, io.netty.handler.codec.socksx.v4.Socks4ServerDecoder, .Socks4ServerEncoder, io.netty.handler.codec.socksx.v5.Socks5AddressEncoder, .Socks5InitialRequestDecoder, .Socks5ServerEncoder, io.netty.util.internal.ObjectUtil, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.util.List

Detects the version of the current SOCKS connection and initializes the pipeline with Socks4ServerDecoder or Socks5InitialRequestDecoder.

Field Summary

Modifier and TypeField and Description
private static final InternalLogger
private final Socks5ServerEncoder
Inherited from io.netty.handler.codec.ByteToMessageDecoder:
COMPOSITE_CUMULATORMERGE_CUMULATOR

Constructor Summary

AccessConstructor and Description
public
SocksPortUnificationServerHandler()

Creates a new instance with the default configuration.

public
SocksPortUnificationServerHandler(Socks5ServerEncoder socks5encoder)

Creates a new instance with the specified Socks5ServerEncoder.

Method Summary

Modifier and TypeMethod and Description
protected void
decode(ChannelHandlerContext ctx, ByteBuf
the ByteBuf from which to read data
in
,
List<Object>
the List to which decoded messages should be added
out
)

Implements abstract io.netty.handler.codec.ByteToMessageDecoder.decode.

Decode the from one ByteBuf to an other.
private static void
private static void
Inherited from io.netty.handler.codec.ByteToMessageDecoder:
actualReadableBytescallDecodechannelInactivechannelReadchannelReadCompletedecodeLastdiscardSomeReadByteshandlerRemovedhandlerRemoved0internalBufferisSingleDecodesetCumulatorsetDiscardAfterReadssetSingleDecodeuserEventTriggered

Field Detail

loggerback to summary
private static final InternalLogger logger
socks5encoderback to summary
private final Socks5ServerEncoder socks5encoder

Constructor Detail

SocksPortUnificationServerHandlerback to summary
public SocksPortUnificationServerHandler()

Creates a new instance with the default configuration.

SocksPortUnificationServerHandlerback to summary
public SocksPortUnificationServerHandler(Socks5ServerEncoder socks5encoder)

Creates a new instance with the specified Socks5ServerEncoder. This constructor is useful when a user wants to use an alternative Socks5AddressEncoder.

Method Detail

decodeback to summary
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception

Implements abstract io.netty.handler.codec.ByteToMessageDecoder.decode.

Doc from io.netty.handler.codec.ByteToMessageDecoder.decode.

Decode the from one ByteBuf to an other. This method will be called till either the input ByteBuf has nothing to read when return from this method or till nothing was read from the input ByteBuf.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this ByteToMessageDecoder belongs to

in:ByteBuf

the ByteBuf from which to read data

out:List<Object>

the List to which decoded messages should be added

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
logKnownVersionback to summary
private static void logKnownVersion(ChannelHandlerContext ctx, SocksVersion version)
logUnknownVersionback to summary
private static void logUnknownVersion(ChannelHandlerContext ctx, byte versionVal)