public class CloseWebSocketFrame extends WebSocketFrame
Constructor and Description |
---|
CloseWebSocketFrame()
Creates a new empty close frame.
|
CloseWebSocketFrame(boolean finalFragment,
int rsv)
Creates a new close frame with no losing getStatus code and no reason text
|
CloseWebSocketFrame(boolean finalFragment,
int rsv,
ByteBuf binaryData)
Creates a new close frame
|
CloseWebSocketFrame(boolean finalFragment,
int rsv,
int statusCode,
java.lang.String reasonText)
Creates a new close frame with closing status code and reason text
|
CloseWebSocketFrame(int statusCode,
java.lang.String reasonText)
Creates a new empty close frame with closing getStatus code and reason text
|
Modifier and Type | Method and Description |
---|---|
CloseWebSocketFrame |
copy()
Create a deep copy of this
ByteBufHolder . |
CloseWebSocketFrame |
duplicate()
Duplicate the
ByteBufHolder . |
java.lang.String |
reasonText()
Returns the reason text as per RFC 6455 If a reason
text is not supplied, an empty string is returned.
|
CloseWebSocketFrame |
retain()
Increases the reference count by
1 . |
CloseWebSocketFrame |
retain(int increment)
Increases the reference count by the specified
increment . |
int |
statusCode()
Returns the closing status code as per RFC 6455.
|
isFinalFragment, rsv, toString
content, contentToString, equals, hashCode, refCnt, release, release
public CloseWebSocketFrame()
public CloseWebSocketFrame(int statusCode, java.lang.String reasonText)
statusCode
- Integer status code as per RFC 6455. For
example, 1000 indicates normal closure.reasonText
- Reason text. Set to null if no text.public CloseWebSocketFrame(boolean finalFragment, int rsv)
finalFragment
- flag indicating if this frame is the final fragmentrsv
- reserved bits used for protocol extensionspublic CloseWebSocketFrame(boolean finalFragment, int rsv, int statusCode, java.lang.String reasonText)
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.public CloseWebSocketFrame(boolean finalFragment, int rsv, ByteBuf binaryData)
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.public int statusCode()
public java.lang.String reasonText()
public CloseWebSocketFrame copy()
ByteBufHolder
ByteBufHolder
.copy
in interface ByteBufHolder
copy
in class WebSocketFrame
public CloseWebSocketFrame duplicate()
ByteBufHolder
ByteBufHolder
. Be aware that this will not automatically call ByteBufHolder.retain()
.duplicate
in interface ByteBufHolder
duplicate
in class WebSocketFrame
public CloseWebSocketFrame retain()
ReferenceCounted
1
.retain
in interface ByteBufHolder
retain
in interface ReferenceCounted
retain
in class WebSocketFrame
public CloseWebSocketFrame retain(int increment)
ReferenceCounted
increment
.retain
in interface ByteBufHolder
retain
in interface ReferenceCounted
retain
in class WebSocketFrame
Copyright © 2008–2018 The Netty Project. All rights reserved.