Click or drag to resize

WebSocketServerStop Method (UInt16, String)

Note: This API is now obsolete.

Stops receiving incoming handshake requests and closes each connection with the specified code and reason.

Namespace:  Sfs2X.WebSocketSharp.Server
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
[ObsoleteAttribute("This method will be removed.")]
public void Stop(
	ushort code,
	string reason
)

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.

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
ArgumentOutOfRangeException

code is less than 1000 or greater than 4999.

-or-

The size of reason is greater than 123 bytes.

ArgumentException

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 underlying TcpListener has failed to stop.
See Also