At 3/13/16 03:19 AM, SkyFire2008 wrote:
Server has two threads: one reads commands from the console and the other accepts client's connection and prints out its messages. Here's the code for the second thread, it's haxe(and yes, I realize that there's a lot of room for improvements):
[...]
I confirm that it doesn't request the policy because the server doesn't output "Sending policy...", which should happen after it accepts the connection requesting the policy. And with local-with-network everything works.
I tested your server by code by compiling it and connecting to it via Python:
import socket
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(("localhost",5000))
print client.recv(10240)
and that showed the expected "Sending policy..." on the server and the Python client printed out the expected payload, so the issue is with your client.
I'm not familiar with Haxe, but I did some reading here, and according to that you need the local-with-networking to access network resources, which would explain why your client only works with that enabled, as you're attempting to access the policy resource over the network.
This Haxe example seems to have socket connections working without needing to use Flash's retarded XML policy crap, so it might be worth taking a look at.