The SmartFoxClient instance can be configured through an external xml configuration file loaded at run-time.
By default, the LoadConfig method loads a file named "config.xml", placed in the same folder of the application file.
If the autoConnect parameter is set to true, on loading completion the Connect(String, Int32) method is automatically called by the API, otherwise the SFSEvent..::.OnConfigLoadSuccessDelegate event is dispatched.
In case of loading error, the SFSEvent..::.OnConfigLoadFailureDelegate event id fired.


Sends:
SFSEvent..::.OnConfigLoadSuccessDelegate
SFSEvent..::.OnConfigLoadFailureDelegate
NOTE:
the SmartFoxClient configuration file (client-side) should not be confused with the SmartFoxServer configuration file (server-side).
Usage Note:
The external xml configuration file has the following structure; ip, port and zone parameters are mandatory, all other parameters are optional.
CopyC#
<SmartFoxClient><ip>127.0.0.1</ip><port>9339</port><zone>simpleChat</zone><debug>true</debug><blueBoxIpAddress>127.0.0.1</blueBoxIpAddress><blueBoxPort>9339</blueBoxPort><smartConnect>true</smartConnect><httpPort>8080</httpPort><httpPollSpeed>750</httpPollSpeed><rawProtocolSeparator>%</rawProtocolSeparator></SmartFoxClient>
Since:
SmartFoxServer Pro v1.6.0
Version:
SmartFoxServer Pro


SFSEvent.onConfigLoadSuccess += OnConfigLoadSuccess; SFSEvent.onConfigLoadFailure += OnConfigLoadFailure; smartFox.LoadConfig("testEnvironmentConfig.xml", false); public void OnConfigLoadSuccess() { Debug.WriteLine("Config file loaded, now connecting..."); smartFox.Connect(smartFox.ipAddress, smartFox.port); } public void OnConfigLoadFailure(string message) { Debug.WriteLine("Failed loading config file: " + message); }
