what's wrong with this code?

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."

It means that the client connection wasn’t accepted by the server. Are you sure you have the correct IP address and port number? 127.0.0.1 is a loopback address, so that assumes the server is running on the same machine as the client. Is that correct? It could also be caused by a firewall issue…

yes they are both correct and the server is running on the same machine. when i use the default example code (which is basically the same as the above code – i only changed “Debug.Log” into “print”), it connects fine, but when i copy the code and put it in a new project (i included the SmartFoxClient.dll file), it somehow can’t connect now.