Creates a new SmartFox instance enabling websocket communication instead of the default socket communication.

Namespace: Sfs2X
Assembly: SmartFox2X (in SmartFox2X.dll) Version: (1.7.0)


public SmartFox(
	UseWebSocket useWebSocket,
	bool debug


Type: Sfs2X.Util..::..UseWebSocket
If set to UseWebSocket.WS, non-secure websocket communication (WS) is used; if set to UseWebSocket.WSS, secure websocket communication (WSS) is used.
Type: System..::..Boolean
If true, the SmartFoxServer API debug messages are logged.


IMPORTANT: this constructor should be used in Unity only and when building for the web only (Unity WEBGL). In fact it is preferable to use the default socket communication, as websocket connection doesn't support BlueBox and HRC systems, the protocol is not binary and not compressed.
This constructor is not available in .Net and Windows Universal DLLs (websocket communication not supported, because redundant).


The following example instantiates the SmartFox class enabling secure websocket communication and debug messages:
 Copy imageCopy
SmartFox sfs = new SmartFox(UseWebSocket.WSS, true);

See Also