Hi guys,
I've encountered strange behavior dealing with Web Player, System.Net.Sockets and PrefetchSocketPolicy function.
It looks like PrefetchSocketPolicy does not work when you need to connect with privileged ports.
Say we have echo server listening on 777 and 8888 ports.
Also there is sockpol.exe (bundled with Unity) running on ports 843 and 10843
I've tested and here is what I got:
1. connect to 777, PrefetchSocketPolicy on 10843 NOT invoked
2. connect to 777, PrefetchSocketPolicy on 10843 invoked
3. connect to 8888, PrefetchSocketPolicy on 10843 NOT invoked
4. connect to 8888, PrefetchSocketPolicy on 10843 invoked
Everything works except option 2, it raises error "SecurityException: Unable to connect, as no valid crossdomain policy was found".
With default behavior when Unity fetches socket policy implicitly via 843 port it works, but I don't want to run sockpol under root.
I've checked all of this in Unity Editor and Web Player build and got the same results.
Has anyone faced similar issues?
Thanks.
P.S. I can include all the source code if needed but no magic there.
↧