Class Socks4ClientDecoder

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler

public class Socks4ClientDecoder extends ReplayingDecoder<Socks4ClientDecoder.State>
Decodes a single Socks4CommandResponse from the inbound ByteBufs. On successful decode, this decoder will forward the received data to the next handler, so that other handler can remove this decoder later. On failed decode, this decoder will discard the received data, so that other handler closes the connection later.
  • Constructor Details

    • Socks4ClientDecoder

      public Socks4ClientDecoder()
  • Method Details

    • decode

      protected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
      Description copied from class: ByteToMessageDecoder
      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.
      Specified by:
      decode in class ByteToMessageDecoder
      Parameters:
      ctx - the ChannelHandlerContext which this ByteToMessageDecoder belongs to
      in - the ByteBuf from which to read data
      out - the List to which decoded messages should be added
      Throws:
      java.lang.Exception - is thrown if an error occurs
    • fail

      private void fail(java.util.List<java.lang.Object> out, java.lang.Exception cause)