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,
ChannelBuffer 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
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getReasonText()
Returns the reason text as per RFC 6455 If a reason
text is not supplied, an empty string is returned.
|
int |
getStatusCode()
Returns the closing status code as per RFC 6455.
|
java.lang.String |
toString() |
getBinaryData, getRsv, isFinalFragment, setBinaryData, setFinalFragment, setRsv
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, ChannelBuffer 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 getStatusCode()
public java.lang.String getReasonText()
public java.lang.String toString()
toString
在类中 java.lang.Object