SmartFoxConnect Method (ConfigData)
Establishes a connection between the client and a SmartFoxServer 2X instance using a configuration object.
SmartFox2X (in SmartFox2X.dll) Version: 184.108.40.206 (1.7.11)
public void Connect(
- Type: Sfs2X.UtilConfigData
The client configuration object.
|ArgumentException||If an invalid host/address or port is passed, and it can't be found in the loaded settings.|Remarks
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";