here is the code:
using UnityEngine;
using System.Collections;
using SmartFoxClientAPI;
public class Connect : MonoBehaviour
{
private string ip = "127.0.0.1";
private int port = 3000;
//private string statusMessage = "";
// Use this for initialization
void Start ()
{
SmartFoxClient smartFox = new SmartFoxClient();
SFSEvent.onConnection += HandleConnection;
smartFox.Connect(ip, port);
}
// Update is called once per frame
void Update ()
{
}
void HandleConnection(bool success, string error)
{
if (success)
{
print("Connection succesfull!");
}
else
{
print("Can't connect!");
}
}
}
i get this on the debug log (the server is running and the port is set to 3000):
"SocketPolicyClient1: Incoming GetPolicyStreamForIP
SocketPolicyClient1: About to BeginConnect to 127.0.0.1:843
SocketPolicyClient1: About to WaitOne
SocketPolicyClient1: Caught exception: No connection could be made because the target machine actively refused it."