1 Reply Latest reply on Sep 16, 2007 2:59 PM by theLoggerGuy

    Flex and Linux help

    theLoggerGuy Level 1
      I have some socket code that works fine in Windows and Mac. However, the socket wont connect or throw an error in the Linux flash player (debug or normal). Below is a code fragment. I can't find any reference to any special circumstances for Linux. If I am doing something wrong, then some help would be greatly appreciated.

      import flash.net.Socket;
      import flash.events.IOErrorEvent;
      import flash.events.SecurityErrorEvent;
      import flash.system.Security;

      private var socket: Socket = new Socket();

      public function connectToLogger( ipAddress: String = null, ipPort: int = 8000): void
      {
      // event for when the server connection is established.
      socket.addEventListener( Event.CONNECT, onConnect );

      // event for when the server closes the socket.
      socket.addEventListener( Event.CLOSE, onClose );

      // event for when there is an I/O error event logged during connection.
      socket.addEventListener( IOErrorEvent.IO_ERROR, onIOError );

      // event for when there is an security error event logged during connection.
      socket.addEventListener( SecurityErrorEvent.SECURITY_ERROR, onSecurityError );

      // Listen for when data is received from the socket server
      socket.addEventListener( ProgressEvent.SOCKET_DATA, onSocketData );

      try
      {
      trace( "Trying to connect (" + ipAddress + ": " + ipPort + ")..." );

      socket.connect( ipAddress, ipPort );
      }
      catch( error: SecurityError )
      {
      trace( "socket.connect error" + error );
      }
      catch( error: IOError )
      {
      trace( "socket.connect error" + error );
      }

      trace( "socket.connected = " + socket.connected );
      }