Click or drag to resize

SmartFox Constructor (UseWebSocket)

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

Namespace:  Sfs2X
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public SmartFox(
	UseWebSocket useWebSocket
)

Parameters

useWebSocket
Type: Sfs2X.UtilUseWebSocket
If set to UseWebSocket.WS_BIN, non-secure websocket communication (WS) is used; if set to UseWebSocket.WSS_BIN, secure websocket communication (WSS) is used.
Remarks
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.
This constructor has no effects if used in native .Net applications and is not available in the Universal Windows Platform DLL (websocket communication not supported, because redundant).

Starting from API v1.7.3, websocket communication uses the default SFS2X binary protocol (see UseWebSocket class). Legacy text protocol is still available for backward compatibility with SmartFoxserver 2X versions prior to 2.13.

Examples
The following example instantiates the SmartFox class enabling websocket communication:
SmartFox sfs = new SmartFox(UseWebSocket.WS_BIN);
See Also