public class CloseWebSocketFrame extends WebSocketFrame
| 构造器和说明 |
|---|
CloseWebSocketFrame()
Creates a new empty close frame.
|
CloseWebSocketFrame(boolean finalFragment,
int rsv)
Creates a new close frame with no losing status 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 status code and reason text
|
CloseWebSocketFrame(WebSocketCloseStatus status)
Creates a new empty close frame with closing status code and reason text
|
CloseWebSocketFrame(WebSocketCloseStatus status,
java.lang.String reasonText)
Creates a new empty close frame with closing status code and reason text
|
| 限定符和类型 | 方法和说明 |
|---|---|
CloseWebSocketFrame |
copy()
Creates a deep copy of this
ByteBufHolder. |
CloseWebSocketFrame |
duplicate()
Duplicates this
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 |
replace(ByteBuf content)
Returns a new
ByteBufHolder which contains the specified content. |
CloseWebSocketFrame |
retain()
Increases the reference count by
1. |
CloseWebSocketFrame |
retain(int increment)
Increases the reference count by the specified
increment. |
CloseWebSocketFrame |
retainedDuplicate()
Duplicates this
ByteBufHolder. |
int |
statusCode()
Returns the closing status code as per RFC 6455.
|
CloseWebSocketFrame |
touch()
Records the current access location of this object for debugging purposes.
|
CloseWebSocketFrame |
touch(java.lang.Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
isFinalFragment, rsv, toStringcontent, contentToString, equals, hashCode, refCnt, release, releasepublic CloseWebSocketFrame()
public CloseWebSocketFrame(WebSocketCloseStatus status)
status - Status code as per RFC 6455. For
example, 1000 indicates normal closure.public CloseWebSocketFrame(WebSocketCloseStatus status, java.lang.String reasonText)
status - Status code as per RFC 6455. For
example, 1000 indicates normal closure.reasonText - Reason text. Set to null if no text.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 extensions.public 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()
DefaultByteBufHolderByteBufHolder.
This method calls replace(content().copy()) by default.
copy 在接口中 ByteBufHoldercopy 在类中 WebSocketFramepublic CloseWebSocketFrame duplicate()
DefaultByteBufHolderByteBufHolder. Be aware that this will not automatically call ByteBufHolder.retain().
This method calls replace(content().duplicate()) by default.
duplicate 在接口中 ByteBufHolderduplicate 在类中 WebSocketFramepublic CloseWebSocketFrame retainedDuplicate()
DefaultByteBufHolderByteBufHolder. This method returns a retained duplicate unlike ByteBufHolder.duplicate().
This method calls replace(content().retainedDuplicate()) by default.
retainedDuplicate 在接口中 ByteBufHolderretainedDuplicate 在类中 WebSocketFrameByteBuf.retainedDuplicate()public CloseWebSocketFrame replace(ByteBuf content)
DefaultByteBufHolderByteBufHolder which contains the specified content.
Override this method to return a new instance of this object whose content is set to the specified
content. The default implementation of DefaultByteBufHolder.copy(), DefaultByteBufHolder.duplicate() and
DefaultByteBufHolder.retainedDuplicate() invokes this method to create a copy.
replace 在接口中 ByteBufHolderreplace 在类中 WebSocketFramepublic CloseWebSocketFrame retain()
ReferenceCounted1.retain 在接口中 ByteBufHolderretain 在接口中 ReferenceCountedretain 在类中 WebSocketFramepublic CloseWebSocketFrame retain(int increment)
ReferenceCountedincrement.retain 在接口中 ByteBufHolderretain 在接口中 ReferenceCountedretain 在类中 WebSocketFramepublic CloseWebSocketFrame touch()
ReferenceCountedResourceLeakDetector. This method is a shortcut to touch(null).touch 在接口中 ByteBufHoldertouch 在接口中 ReferenceCountedtouch 在类中 WebSocketFramepublic CloseWebSocketFrame touch(java.lang.Object hint)
ReferenceCountedResourceLeakDetector.touch 在接口中 ByteBufHoldertouch 在接口中 ReferenceCountedtouch 在类中 WebSocketFrame