Click or drag to resize

WebSocketSessionManagerCloseSession Method (String, CloseStatusCode, String)

Closes the specified session with code and reason.

Namespace:  Sfs2X.WebSocketSharp.Server
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public void CloseSession(
	string id,
	CloseStatusCode code,
	string reason
)

Parameters

id
Type: SystemString
A String that represents the ID of the session to close.
code
Type: Sfs2X.WebSocketSharpCloseStatusCode

One of the CloseStatusCode enum values.

It represents the status code indicating the reason for the close.

reason
Type: SystemString

A String that represents the reason for the close.

The size must be 123 bytes or less in UTF-8.

Exceptions
ExceptionCondition
ArgumentNullExceptionid is .
ArgumentException

id is an empty string.

-or-

code is MandatoryExtension.

-or-

code is NoStatus and there is reason.

-or-

reason could not be UTF-8-encoded.

InvalidOperationException The session could not be found.
ArgumentOutOfRangeException The size of reason is greater than 123 bytes.
See Also