If i test in Unity standalone i get this error :
Code: Select all
[SFS DEBUG] TCPSocketLayer: Connection error: No connection could be made because the target machine actively refused it.Code: Select all
Security Exception. Policy file load failed!Code: Select all
[SFS DEBUG] TCPSocketLayer: General exception on connection: Unable to connect, as no valid crossdomain policy was foundCode: Select all
void Awake() {
Application.runInBackground = true;
//StartCoroutine("Login");
// In a webplayer (or editor in webplayer mode) we need to setup security policy negotiation with the server first
if (Application.isWebPlayer || Application.isEditor) {
if (!Security.PrefetchSocketPolicy(serverName, serverPort, 500)) {
Debug.LogError("Security Exception. Policy file load failed!");
}
}
if (SmartFoxConnection.IsInitialized)
{
smartFox = SmartFoxConnection.Connection;
} else {
smartFox = new SmartFox(debug);
}
// Register callback delegate
smartFox.AddEventListener(SFSEvent.CONNECTION, OnConnection);
smartFox.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost);
smartFox.AddEventListener(SFSEvent.LOGIN, OnLogin);
smartFox.AddLogListener(LogLevel.DEBUG, OnDebugMessage);
smartFox.Connect(serverName, serverPort);
}Code: Select all
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>Thanks for your help !