Page 1 of 1

SFS + Web Player, PrefetchSocketPolicy

Posted: 25 Feb 2013, 08:11
by Zelek
I am using Unity 4 and SFS on an Amazon ec2 instance. Everything works fine in standalone, but the web build is not able to connect to SFS. I have a call to "Security.PrefetchSocketPolicy", but it always returns false (and I'm not sure if it's even necessary in the current SFS with Unity 4).

I probably missed a step somewhere along the way. Is the Public DNS of the ec2 instance a valid parameter for PrefetchSocketPolicy? Is it necessary to modify crossdomain.xml and/or place it at the root of my web server?

Re: SFS + Web Player, PrefetchSocketPolicy

Posted: 25 Feb 2013, 09:40
by Lapo
<< Moved in the Unity Section >>

Have you checked the WebPlayer logs for specific errors?
Is the Public DNS of the ec2 instance a valid parameter for PrefetchSocketPolicy?

Public DNS? Do you mean public IP Address, maybe? If so yes, it is correct.

Please check those error logs and let us know

Re: SFS + Web Player, PrefetchSocketPolicy

Posted: 26 Feb 2013, 03:38
by Zelek
This is the error I found in the web player logs (with replaced IP):

Code: Select all

SocketPolicyClient2: Incoming GetPolicyStreamForIP
SocketPolicyClient2: About to BeginConnect to 123.456.78.90:843
SocketPolicyClient2: About to WaitOne
SocketPolicyClient2: WaitOne timed out. Duration: 3002.1718
SocketPolicyClient2: Caught exception: BeginConnect timed out
[SFS - ERROR] TCPSocketLayer: General exception on connection: Unable to connect, as no valid crossdomain policy was found


I guess it was parsing this IP from my fully qualified ec2 instance form, i.e. "ec2-123-456-78-90.compute-1.amazonaws.com". I decided to try associating an elastic IP with my instance, and using that IP in the code, and it works! Thanks, Lapo, for suggesting the web player logs; I honestly didn't even know they existed :).

Re: SFS + Web Player, PrefetchSocketPolicy

Posted: 26 Feb 2013, 12:55
by Lapo
Ok, good :)