Class ControlFrame
java.lang.Object
org.eclipse.jetty.websocket.common.WebSocketFrame
org.eclipse.jetty.websocket.common.frames.ControlFrame
- All Implemented Interfaces:
Frame
- Direct Known Subclasses:
CloseFrame
,PingFrame
,PongFrame
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.websocket.api.extensions.Frame
Frame.Type
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Maximum size of Control frame, per RFC 6455Fields inherited from class org.eclipse.jetty.websocket.common.WebSocketFrame
data, finRsvOp, mask, masked
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
Get the payload ByteBuffer.boolean
boolean
setPayload
(ByteBuffer buf) Set the data payload.Methods inherited from class org.eclipse.jetty.websocket.common.WebSocketFrame
copy, copyHeaders, copyHeaders, getMask, getOpCode, getPayloadAsUTF8, getPayloadLength, getType, hashCode, hasPayload, isFin, isLast, isMasked, isRsv1, isRsv2, isRsv3, reset, setFin, setMask, setMasked, setOpCode, setRsv1, setRsv2, setRsv3, toString
-
Field Details
-
MAX_CONTROL_PAYLOAD
public static final int MAX_CONTROL_PAYLOADMaximum size of Control frame, per RFC 6455- See Also:
-
-
Constructor Details
-
ControlFrame
public ControlFrame(byte opcode)
-
-
Method Details
-
assertValid
public void assertValid()- Specified by:
assertValid
in classWebSocketFrame
-
equals
- Overrides:
equals
in classWebSocketFrame
-
isControlFrame
public boolean isControlFrame()- Specified by:
isControlFrame
in classWebSocketFrame
-
isDataFrame
public boolean isDataFrame()- Specified by:
isDataFrame
in classWebSocketFrame
-
setPayload
Description copied from class:WebSocketFrame
Set the data payload.The provided buffer will be used as is, no copying of bytes performed.
The provided buffer should be flipped and ready to READ from.
- Overrides:
setPayload
in classWebSocketFrame
- Parameters:
buf
- the bytebuffer to set- Returns:
- the frame itself
-
getPayload
Description copied from class:WebSocketFrame
Get the payload ByteBuffer. possible null.- Specified by:
getPayload
in interfaceFrame
- Overrides:
getPayload
in classWebSocketFrame
-