3 Replies Latest reply on Feb 1, 2011 12:29 PM by oldMster

    Simple Socket Question / Error...

    lushdoggg

      I'm testing out a socket connection for an RDP app on the playbook.

       

      Flash Builder Burrito 4.5

      Adobe AIR SDK 2.5 Hero

      Playbook SDK 0.9.2

      Playbook Sim 0.9.2

      VMPlayer running in Bridged Networking mode

       

       

      public function RDPApp()
                {
                     var socket:Socket = new Socket();
                     socket.addEventListener(Event.CONNECT, onConnect);
                     socket.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
                     socket.addEventListener(Event.CLOSE, onClose);
                     socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
                     socket.addEventListener(ProgressEvent.SOCKET_DATA, onReceivedData);
                     socket.connect("http://www.google.com", 80);
                     socket.close();
                     
                     stage.nativeWindow.visible = true;
                }
                
                
                private function closeWindow(event:MouseEvent):void{
                     stage.nativeWindow.close();
                }
                
                protected function onConnect(event:Event):void
                {
                     // TODO Auto-generated method stub
                }
                
                protected function onIOError(event:IOErrorEvent):void
                {
                     trace(event);
                }
                
                protected function onClose(event:Event):void
                {
                     // TODO Auto-generated method stub
                }
                
                protected function onSecurityError(event:SecurityErrorEvent):void
                {
                     // TODO Auto-generated method stub
                }
                
                protected function onReceivedData(event:ProgressEvent):void
                {
                     // TODO Auto-generated method stub
                }

       

       

      The code above throws on the sim and on the desktop:

       

      IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL:http://www.google.com" errorID=2031]

       

      Googling this error message indicates that the client flash app has not received the required policy file from the server.

       

      I was under the impression that AIR apps running on the desktop sandbox (Playbook included) do not require the retrieval of the policy file.

       

      Any help is much appreciated.

       

      Matt