0 Replies Latest reply on Mar 13, 2013 2:11 PM by ksukat

    sockets & Data/Services in flashbuilder 4.5

    ksukat Level 1

      greetings,

      I have created a flex application in flashbuilder 4.5 premium for php.   It uses php code and a postgresql database.

      It uses Zend so I can do AMF.   It all works fine.

       

      I need to add the ability to listen to a socket to get data from another program.   I created a test application

      that did not have services enabled (ie, php and postgresql).  I was able to connect to the socket, listen and parse

      the data no problem.  So I think I can copy the code into my application and things will work.

       

      Copied the code into my real application and it does not work.   When flex connects to the socket, it appear to

      be automatically writing something to the socket (the other program reads this as an int 60).  This did not

      happen with the test application.

       

      Any ideas on what is causing this?  I have the connect stripped down to the bare basics.  This is driving me a bit

      crazy.

       

      Security.loadPolicyFile("xxx.xxx.xxx.xxx:843");

      daemon_socket = new Socket();

      daemon_socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onSEcurityError);

      daemon_socket.addeventListener(IOErrorEvent.IO_ERROR,onIOError);

      daemon_socket.addEventListener(Event.CONNECT,daemon_onConnect);

      daemon_socket.addEventListener(ProgressEvent.SOCKET_DATA,daemon_onProgressEvent);

       

      daemon_socket.connect("xxx.xxx.xxx.xxx",yyyy);

       

      xxx.xxx.xxx.xxx is the ip address I am using, and yyyy is the port.

       

      thanks.