Click or drag to resize

WebSocketCloseAsync Method (UInt16)

Closes the connection asynchronously with the specified code.

Namespace:  Sfs2X.WebSocketSharp
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public void CloseAsync(
	ushort code
)

Parameters

code
Type: SystemUInt16

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.

Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptioncode is less than 1000 or greater than 4999.
ArgumentException

code is 1011 (server error). It cannot be used by clients.

-or-

code is 1010 (mandatory extension). It cannot be used by servers.

Remarks

This method does not wait for the close to be complete.

This method does nothing if the current state of the connection is Closing or Closed.

See Also