Class Parser
java.lang.Object
org.eclipse.jetty.websocket.common.Parser
Parsing of a frames in WebSocket land.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.eclipse.jetty.io.ByteBufferPool
private int
private byte
Is there an extension using RSV flag?private WebSocketFrame
private IncomingFrames
private static final org.eclipse.jetty.util.log.Logger
private PayloadProcessor
private final LongAdder
private ByteBuffer
private int
private final WebSocketPolicy
private boolean
private Parser.State
-
Constructor Summary
ConstructorsConstructorDescriptionParser
(WebSocketPolicy wspolicy, org.eclipse.jetty.io.ByteBufferPool bufferPool) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
assertSanePayloadLength
(long len) void
configureFromExtensions
(List<? extends Extension> exts) long
boolean
boolean
boolean
protected void
notifyFrame
(Frame f) void
parse
(ByteBuffer buffer) private boolean
parseFrame
(ByteBuffer buffer) Parse the base framing protocol buffer.private boolean
parsePayload
(ByteBuffer buffer) Implementation specific parsing of a payloadvoid
parseSingleFrame
(ByteBuffer buffer) private void
reset()
void
setIncomingFramesHandler
(IncomingFrames incoming) toString()
-
Field Details
-
LOG
private static final org.eclipse.jetty.util.log.Logger LOG -
policy
-
bufferPool
private final org.eclipse.jetty.io.ByteBufferPool bufferPool -
messagesIn
-
state
-
cursor
private int cursor -
frame
-
priorDataFrame
private boolean priorDataFrame -
payload
-
payloadLength
private int payloadLength -
maskProcessor
-
flagsInUse
private byte flagsInUseIs there an extension using RSV flag?0100_0000 (0x40) = rsv1 0010_0000 (0x20) = rsv2 0001_0000 (0x10) = rsv3
-
incomingFramesHandler
-
-
Constructor Details
-
Parser
-
-
Method Details
-
assertSanePayloadLength
private void assertSanePayloadLength(long len) -
configureFromExtensions
-
getIncomingFramesHandler
-
getPolicy
-
isRsv1InUse
public boolean isRsv1InUse() -
isRsv2InUse
public boolean isRsv2InUse() -
isRsv3InUse
public boolean isRsv3InUse() -
notifyFrame
- Throws:
WebSocketException
-
parse
- Throws:
WebSocketException
-
parseSingleFrame
- Throws:
WebSocketException
-
reset
private void reset() -
parseFrame
Parse the base framing protocol buffer.Note the first byte (fin,rsv1,rsv2,rsv3,opcode) are parsed by the
parse(ByteBuffer)
methodNot overridable
- Parameters:
buffer
- the buffer to parse from.- Returns:
- true if done parsing base framing protocol and ready for parsing of the payload. false if incomplete parsing of base framing protocol.
-
parsePayload
Implementation specific parsing of a payload- Parameters:
buffer
- the payload buffer- Returns:
- true if payload is done reading, false if incomplete
-
setIncomingFramesHandler
-
getMessagesIn
public long getMessagesIn() -
toString
-