Class CloseWebSocketFrame
java.lang.Object
io.netty.buffer.DefaultByteBufHolder
io.netty.handler.codec.http.websocketx.WebSocketFrame
io.netty.handler.codec.http.websocketx.CloseWebSocketFrame
- All Implemented Interfaces:
io.netty.buffer.ByteBufHolder,io.netty.util.ReferenceCounted
Web Socket Frame for closing the connection.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty close frame.CloseWebSocketFrame(boolean finalFragment, int rsv) Creates a new close frame with no losing status code and no reason textCloseWebSocketFrame(boolean finalFragment, int rsv, int statusCode, String reasonText) Creates a new close frame with closing status code and reason textCloseWebSocketFrame(boolean finalFragment, int rsv, io.netty.buffer.ByteBuf binaryData) Creates a new close frameCloseWebSocketFrame(int statusCode, String reasonText) Creates a new empty close frame with closing status code and reason textCreates a new empty close frame with closing status code and reason textCloseWebSocketFrame(WebSocketCloseStatus status, String reasonText) Creates a new empty close frame with closing status code and reason text -
Method Summary
Methods inherited from class io.netty.handler.codec.http.websocketx.WebSocketFrame
isFinalFragment, rsv, toStringMethods inherited from class io.netty.buffer.DefaultByteBufHolder
content, contentToString, equals, hashCode, refCnt, release, release
-
Constructor Details
-
CloseWebSocketFrame
public CloseWebSocketFrame()Creates a new empty close frame. -
CloseWebSocketFrame
Creates a new empty close frame with closing status code and reason text- Parameters:
status- Status code as per RFC 6455. For example, 1000 indicates normal closure.
-
CloseWebSocketFrame
Creates a new empty close frame with closing status code and reason text- Parameters:
status- Status code as per RFC 6455. For example, 1000 indicates normal closure.reasonText- Reason text. Set to null if no text.
-
CloseWebSocketFrame
Creates a new empty close frame with closing status code and reason text- Parameters:
statusCode- Integer status code as per RFC 6455. For example, 1000 indicates normal closure.reasonText- Reason text. Set to null if no text.
-
CloseWebSocketFrame
public CloseWebSocketFrame(boolean finalFragment, int rsv) Creates a new close frame with no losing status code and no reason text- Parameters:
finalFragment- flag indicating if this frame is the final fragmentrsv- reserved bits used for protocol extensions.
-
CloseWebSocketFrame
Creates a new close frame with closing status code and reason text- Parameters:
finalFragment- flag indicating if this frame is the final fragmentrsv- reserved bits used for protocol extensionsstatusCode- Integer status code as per RFC 6455. For example, 1000 indicates normal closure.reasonText- Reason text. Set to null if no text.
-
CloseWebSocketFrame
public CloseWebSocketFrame(boolean finalFragment, int rsv, io.netty.buffer.ByteBuf binaryData) Creates a new close frame- Parameters:
finalFragment- flag indicating if this frame is the final fragmentrsv- reserved bits used for protocol extensionsbinaryData- the content of the frame. Must be 2 byte integer followed by optional UTF-8 encoded string.
-
-
Method Details
-
statusCode
public int statusCode()Returns the closing status code as per RFC 6455. If a status code is set, -1 is returned. -
reasonText
Returns the reason text as per RFC 6455 If a reason text is not supplied, an empty string is returned. -
copy
- Specified by:
copyin interfaceio.netty.buffer.ByteBufHolder- Overrides:
copyin classWebSocketFrame
-
duplicate
- Specified by:
duplicatein interfaceio.netty.buffer.ByteBufHolder- Overrides:
duplicatein classWebSocketFrame
-
retainedDuplicate
- Specified by:
retainedDuplicatein interfaceio.netty.buffer.ByteBufHolder- Overrides:
retainedDuplicatein classWebSocketFrame
-
replace
- Specified by:
replacein interfaceio.netty.buffer.ByteBufHolder- Specified by:
replacein classWebSocketFrame
-
retain
- Specified by:
retainin interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Overrides:
retainin classWebSocketFrame
-
retain
- Specified by:
retainin interfaceio.netty.buffer.ByteBufHolder- Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Overrides:
retainin classWebSocketFrame
-
touch
- Specified by:
touchin interfaceio.netty.buffer.ByteBufHolder- Specified by:
touchin interfaceio.netty.util.ReferenceCounted- Overrides:
touchin classWebSocketFrame
-
touch
- Specified by:
touchin interfaceio.netty.buffer.ByteBufHolder- Specified by:
touchin interfaceio.netty.util.ReferenceCounted- Overrides:
touchin classWebSocketFrame
-