SFS + Web Player, PrefetchSocketPolicy

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

User avatar
Zelek
Posts: 36
Joined: 24 Jun 2010, 22:36

SFS + Web Player, PrefetchSocketPolicy

Postby Zelek » 25 Feb 2013, 08:11

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?
User avatar
Lapo
Site Admin
Posts: 21077
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFS + Web Player, PrefetchSocketPolicy

Postby Lapo » 25 Feb 2013, 09:40

<< 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
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Zelek
Posts: 36
Joined: 24 Jun 2010, 22:36

Re: SFS + Web Player, PrefetchSocketPolicy

Postby Zelek » 26 Feb 2013, 03:38

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 :).
User avatar
Lapo
Site Admin
Posts: 21077
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFS + Web Player, PrefetchSocketPolicy

Postby Lapo » 26 Feb 2013, 12:55

Ok, good :)
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 4 guests