Socket connection problem

Hi,
I am trying to connect to a socket using an URL and a port number:

  • I load the security parameters
Security.loadPolicyFile("http://xxx/xxx/crossdomain.xml");
  • the xml is
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" secure="false"  to-ports="8083" />
  <allow-http-request-headers-from domain="*" headers="SOAPAction" secure="false"/>
</cross-domain-policy>
  • I (try to) start the connection
var client:Socket = new Socket();
client.connect(xxx.xxx.xxx.xxx, 8083);
  • but at runtime I receive the error
Error #2044: unhandled securityError:. text=Error #2048: Security [COLOR=#000000]sandbox[/COLOR] violation: http://xxx/xxx.swf cannot load data from xxx.xxx.xxx.xxx:8083.

I have seen a lot of people asking about this problem, and the solution should be the crossdomain.xml, but not in this case: WHY? The xml is loaded correctly, I can see it in the log