WebSocketSessionManagerCloseSession Method (String, UInt16, String) |
Namespace: Sfs2X.WebSocketSharp.Server
public void CloseSession( string id, ushort code, string reason )
A UInt16 that represents the status code indicating the reason for the close.
The status codes are defined in Section 7.4 of RFC 6455.
A String that represents the reason for the close.
The size must be 123 bytes or less in UTF-8.
Exception | Condition |
---|---|
ArgumentNullException | id is . |
ArgumentException | id is an empty string. -or- code is 1010 (mandatory extension). -or- code is 1005 (no status) and there is reason. -or- reason could not be UTF-8-encoded. |
InvalidOperationException | The session could not be found. |
ArgumentOutOfRangeException | code is less than 1000 or greater than 4999. -or- The size of reason is greater than 123 bytes. |