Class Socks5InitialResponseDecoder

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler

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

    • Socks5InitialResponseDecoder

      public Socks5InitialResponseDecoder()
  • 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)