Establishes a connection between the client and a SmartFoxServer 2X instance using a configuration object.Namespace: Sfs2X
Assembly: SmartFox2X (in SmartFox2X.dll) Version: 220.127.116.11 (1.7.0)
public void Connect( ConfigData cfg )
- Type: Sfs2X.Util..::..ConfigData
The client configuration object.
The client usually connects to a SmartFoxServer instance through a socket connection. In case a socket connection can't be established, and the UseBlueBox property is set to true, a tunnelled http connection through the BlueBox module is attempted as a fail-safe system. When a successful connection is established, the ConnectionMode property can be used to check the current connection mode. Tunnelled http connection is not available in case of websocket connection.
The following example connects to a local SmartFoxServer 2X instance:
ConfigData cfg = new ConfigData(); cfg.Host = "127.0.0.1"; cfg.Port = 9933; cfg.Zone = "BasicExamples"; sfs.Connect(cfg);
|If an invalid host/address or port is passed, and it can't be found in the loaded settings.|