# Socket connection problem

**URL:** <https://forum.kirupa.com/t/socket-connection-problem/328527>\
**Category:** Uncategorized\
**Created:** [May 23, 2012, 12:42pm UTC](https://forum.kirupa.com/t/socket-connection-problem/328527 "2012-05-23T12:42:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GiGaGiG](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@GiGaGiG](https://forum.kirupa.com/u/GiGaGiG)\
**Post date:** [May 23, 2012, 12:42pm UTC](https://forum.kirupa.com/t/socket-connection-problem/328527/1 "2012-05-23T12:42:01Z")

</div>

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

- I load the security parameters

```auto
Security.loadPolicyFile("http://xxx/xxx/crossdomain.xml");

```

- the xml is

```auto
<?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

```auto
var client:Socket = new Socket();
client.connect(xxx.xxx.xxx.xxx, 8083);

```

- but at runtime I receive the error

```auto
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
