SmartFoxServer Silverlight API
SFSEvent..::.OnConnectionDelegate Delegate
Namespaces ► SmartFoxClientAPI ► SFSEvent ► SFSEvent..::.OnConnectionDelegate
Dispatched in response to the Connect(String, Int32) request.
The connection to SmartFoxServer may have succeeded or failed: the success parameter must be checked.
Declaration Syntax

C# | Visual Basic | Visual C++

    public delegate void OnConnectionDelegate(
    	bool success,
    	string error
    )

    Public Delegate Sub OnConnectionDelegate ( _
    	success As Boolean, _
    	error As String _
    )

    public delegate void OnConnectionDelegate(
    	bool success,
    	String^ error
    )

Parameters

success (Boolean)
  the connection result: true if the connection succeeded, false if the connection failed.

error (String)
  the error message in case of connection failure.

Remarks

Version:
SmartFoxServer Basic / Pro

Examples
The following example shows how to handle the connection result.
CopyC#

     SFSEvent.onConnection += OnConnection;

    smartFox.Connect("127.0.0.1", 9339);

    public void OnConnection(bool success, string error)
    {
        if (success)
            Debug.WriteLine("Connection successful");
        else
            Debug.WriteLine("Connection failed. Reason: " + error);
    }

See Also
Connect(String, Int32)

Assembly: SmartFoxClientAPI_Silverlight (Module: SmartFoxClientAPI_Silverlight) Version: 1.0.0.0 (1.0.0.0)