public class HandshakeDecoder extends Object implements IDecoder<byte[],HandshakeFrame>, IBaseDecoder<byte[],HandshakeFrame>
Constructor and Description |
---|
HandshakeDecoder(boolean clientMode)
Constructs a Web Socket handshake decoder with the default maximum length
(65536) of a handshake frame and the default maximum number (50) of lines of
a handshake frame to be decoded in a single pass.
|
HandshakeDecoder(boolean clientMode,
int maxLength)
Constructs a Web Socket handshake decoder with the default maximum number
(50) of lines of a handshake frame to be decoded in a single pass.
|
HandshakeDecoder(boolean clientMode,
int maxLength,
int maxLinesInChunk)
Constructs a Web Socket handshake decoder.
|
Modifier and Type | Method and Description |
---|---|
int |
available(ISession session,
byte[] buffer,
int off,
int len) |
int |
available(ISession session,
ByteBuffer buffer,
boolean flipped) |
void |
decode(ISession session,
byte[] data,
List<HandshakeFrame> out) |
Class<byte[]> |
getInboundType() |
Class<HandshakeFrame> |
getOutboundType() |
public HandshakeDecoder(boolean clientMode, int maxLength, int maxLinesInChunk)
clientMode
- determines the mode (client/server) in which the
decoder should workmaxLength
- maximum length of a handshake frame. Setting it to an
appropriate value can prevent from denial of service
attacksmaxLinesInChunk
- maximum number of lines of a Web Socket handshake
frame to be decoded in a single pass. Setting it to an
appropriate value can improve performance of decoding
frames with big number of lines.public HandshakeDecoder(boolean clientMode, int maxLength)
clientMode
- determines the mode (client/server) in which the decoder
should workmaxLength
- maximum length of a handshake frame. Setting it to an
appropriate value can prevent from denial of service
attackspublic HandshakeDecoder(boolean clientMode)
clientMode
- determines the mode (client/server) in which the decoder
should workpublic Class<byte[]> getInboundType()
getInboundType
in interface ICodec<byte[],HandshakeFrame>
public Class<HandshakeFrame> getOutboundType()
getOutboundType
in interface ICodec<byte[],HandshakeFrame>
public void decode(ISession session, byte[] data, List<HandshakeFrame> out) throws Exception
decode
in interface IDecoder<byte[],HandshakeFrame>
Exception
public int available(ISession session, ByteBuffer buffer, boolean flipped)
available
in interface IBaseDecoder<byte[],HandshakeFrame>
public int available(ISession session, byte[] buffer, int off, int len)
available
in interface IBaseDecoder<byte[],HandshakeFrame>
Copyright © 2017–2022 SNF4J.ORG. All rights reserved.