Click or drag to resize

WebSocket Constructor

Initializes a new instance of the WebSocket class with url and optionally protocols.

Namespace:  Sfs2X.WebSocketSharp
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public WebSocket(
	string url,
	params string[] protocols
)

Parameters

url
Type: SystemString

A String that specifies the URL to which to connect.

The scheme of the URL must be ws or wss.

The new instance uses a secure connection if the scheme is wss.

protocols
Type: SystemString

An array of String that specifies the names of the subprotocols if necessary.

Each value of the array must be a token defined in RFC 2616.

Exceptions
ExceptionCondition
ArgumentNullExceptionurl is .
ArgumentException

url is an empty string.

-or-

url is an invalid WebSocket URL string.

-or-

protocols contains a value that is not a token.

-or-

protocols contains a value twice.

See Also