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 status code and no reason text
|
CloseWebSocketFrame(boolean finalFragment,
int rsv,
io.netty.buffer.ByteBuf binaryData)
Creates a new close frame
|
CloseWebSocketFrame(boolean finalFragment,
int rsv,
int statusCode,
String reasonText)
Creates a new close frame with closing status code and reason text
|
CloseWebSocketFrame(int statusCode,
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,
String reasonText)
Creates a new empty close frame with closing status code and reason text
|
Modifier and Type | Method and Description |
---|---|
CloseWebSocketFrame |
copy() |
CloseWebSocketFrame |
duplicate() |
String |
reasonText()
Returns the reason text as per RFC 6455 If a reason
text is not supplied, an empty string is returned.
|
CloseWebSocketFrame |
replace(io.netty.buffer.ByteBuf content) |
CloseWebSocketFrame |
retain() |
CloseWebSocketFrame |
retain(int increment) |
CloseWebSocketFrame |
retainedDuplicate() |
int |
statusCode()
Returns the closing status code as per RFC 6455.
|
CloseWebSocketFrame |
touch() |
CloseWebSocketFrame |
touch(Object hint) |
isFinalFragment, rsv, toString
public CloseWebSocketFrame()
public CloseWebSocketFrame(WebSocketCloseStatus status)
status
- Status code as per RFC 6455. For
example, 1000 indicates normal closure.public CloseWebSocketFrame(WebSocketCloseStatus status, 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, 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, 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, io.netty.buffer.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 String reasonText()
public CloseWebSocketFrame copy()
copy
in interface io.netty.buffer.ByteBufHolder
copy
in class WebSocketFrame
public CloseWebSocketFrame duplicate()
duplicate
in interface io.netty.buffer.ByteBufHolder
duplicate
in class WebSocketFrame
public CloseWebSocketFrame retainedDuplicate()
retainedDuplicate
in interface io.netty.buffer.ByteBufHolder
retainedDuplicate
in class WebSocketFrame
public CloseWebSocketFrame replace(io.netty.buffer.ByteBuf content)
replace
in interface io.netty.buffer.ByteBufHolder
replace
in class WebSocketFrame
public CloseWebSocketFrame retain()
retain
in interface io.netty.buffer.ByteBufHolder
retain
in interface io.netty.util.ReferenceCounted
retain
in class WebSocketFrame
public CloseWebSocketFrame retain(int increment)
retain
in interface io.netty.buffer.ByteBufHolder
retain
in interface io.netty.util.ReferenceCounted
retain
in class WebSocketFrame
public CloseWebSocketFrame touch()
touch
in interface io.netty.buffer.ByteBufHolder
touch
in interface io.netty.util.ReferenceCounted
touch
in class WebSocketFrame
public CloseWebSocketFrame touch(Object hint)
touch
in interface io.netty.buffer.ByteBufHolder
touch
in interface io.netty.util.ReferenceCounted
touch
in class WebSocketFrame
Copyright © 2008–2023 The Netty Project. All rights reserved.