Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7583237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:37:50+00:00 2026-05-30T18:37:50+00:00

Before I start I should state I have read it all, I was following

  • 0

Before I start I should state I have read it all, I was following this, this and this (and more…) and still I cannot connect to our running server via Socket over the internet.

Here is what I try to in AS3:

        var host :String = "192.168.2.11";
        Security.allowDomain(host);
        Security.allowInsecureDomain(host);
        Security.loadPolicyFile("xmlsocket://" + host + ":" +  "843");

        // TTS server socket
        _socket = new Socket();
        _socket.addEventListener(Event.CLOSE, handleClose);
        _socket.addEventListener(IOErrorEvent.IO_ERROR, handleError);
        _socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleSecError);
        _socket.addEventListener(ProgressEvent.SOCKET_DATA, handleIncomingData);
        _socket.addEventListener(Event.CONNECT, handleConnect);
        _socket.connect(host, 1337);

As you can see, the host is a local address, but that shouldn’t matter as long as I am in this local network. And I am, since this does work from my IDE (FD4).
Also, the swf is on the same server as the application it tries to connect to, but on another port.

The policy file the server sends (we have tried both from port 843 and 1337) is the following:

<?xml version="1.0"?> 
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> 
<cross-domain-policy> 
    <allow-access-from domain="*" to-ports="*" /> 
</cross-domain-policy>

We can see from the log output of the server that this is really sent to the connecting socket. A null byte is of course sent after the xml data. And after that, the server closes the connection. However, it seems that Flash somehow does not like it, as “Error #2048” still appears after ~3 seconds.

We’re really out of ideas here…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:37:51+00:00Added an answer on May 30, 2026 at 6:37 pm

    We managed to get it to work by including another tag:

    <site-control permitted-cross-domain-policies="master-only"/>
    

    It seems that this tag is necessary in order to get it to work. We could not get it to work without that tag, no matter which port we tried.

    So the complete xml now looks like this in our case (it is of course easy to modify to fit any case):

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
       <site-control permitted-cross-domain-policies="master-only"/>
       <allow-access-from domain="*" to-ports="*"/>
    </cross-domain-policy>
    

    It really is a shame that this line is not included in Adobe’s own example (!!). I mean, it IS included in the example files, but not in the article. I don’t want to know how many people were stuck at this stage because of that…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(before I start I should say yes, I have done all the stupidity checks,
I have seen the following links before posting this question http://www.devx.com/wireless/Article/40792/1954 Saving Android Activity
I know I should spend more time researching this and having a go before
Before I start, I know there is this post and it doesn't answer my
Before you start firing at me, I'm NOT looking to do this, but someone
Before I start: I'm programming for Iphone, using objective C. I have already implemented
Just want to check I have my theory right before I start implementing. Constants:
Before start let me tell my experience: I am experienced with C#.NET, web services,
I want to get one record before start date and end date DtpFrom means
I usually try to do TDD with not much analysis (no diagrams) before start

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.