1 Reply Latest reply on Feb 17, 2008 8:27 PM by Gaurav J

    Different Behaviour within Flex and on Browser

    michalis0
      Hi,

      I am using an XMLsocket in my problem (client and server on the same machine).
      As server I have modified slightly the java example from the help (server on port 5050).

      When I run my program within Flex (run button), program is run, it connects and accepts
      data from the server. When I try to run the program outside flex (run the html in the browser),
      then no connection seems to be made to the java program.

      Are any settings of the browser (firefox) configured differently when running through Flex?

      ------------------------------------------------------------------------------------------ ----------------------------

      server part:

      socket = new ServerSocket(port);
      incoming = socket.accept();
      readerIn = new BufferedReader(new InputStreamReader(incoming.getInputStream()));

      // open up standard input
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


      printOut = new PrintStream(incoming.getOutputStream());
      printOut.println("Enter EXIT to exit.\r\0");
      out("Enter EXIT to exit.\r");
      boolean done = false;
      while (!done)
      {
      //String str = readerIn.readLine();
      String str = br.readLine();

      out("Echo: " + str);
      if(str.trim().equals("EXIT"))
      {
      done = true;
      }


      }

      ====================================
      when run outside flex, surprisingly I can see the:
      "Enter EXIT to exit" on the screen but whenever i type something
      it does not appear on the Flex client. This works as it is supposed to,
      when executing within Flex...

      thanks
        • 1. Re: Different Behaviour within Flex and on Browser
          Gaurav J Adobe Employee
          When you say run from the browser.. is the request served by a web server?

          You may be running into crossdomain issues in the 2nd case. I would suggest that you print the input stream data from the XML Socket to see if its sending a request for crossdomain.xml? If that is the case, you should first send the response with the policy file back so that subsequent calls succeed.

          Thanks,
          Gaurav Jain
          Flex SDK Team