WebSocketClose Method (CloseStatusCode, String) |
Namespace: Sfs2X.WebSocketSharp
public void Close( CloseStatusCode code, string reason )
One of the CloseStatusCode enum values.
It represents the status code indicating the reason for the close.
A String that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
Exception | Condition |
---|---|
ArgumentException | code is ServerError. It cannot be used by clients. -or- code is MandatoryExtension. It cannot be used by servers. -or- code is NoStatus and there is reason. -or- reason could not be UTF-8-encoded. |
ArgumentOutOfRangeException | The size of reason is greater than 123 bytes. |