 
       dispatchEvent(new Event('connected'));
     }
+
+    private function onIOError(event:IOErrorEvent):void {
+      ErrorManager.dispatchError(732, [event.text]);
+      dispatchEvent(new ClientEvent(ClientEvent.ABORTED));
+    }
+
+    private function onSecurityError(event:SecurityErrorEvent):void {
+      ErrorManager.dispatchError(731, [event.text]);
+      dispatchEvent(new ClientEvent(ClientEvent.ABORTED));
+    }
   }
 }

      getChannel.readBytes(bytes, offset, length);
    }

    private function onError(e:ErrorEvent):void {
      trace("HTTPClient socket error");
    }

    public function disconnect():void {
      if (getChannel.connected) {
        getChannel.close();
      }
      if (postChannel.connected) {
        postChannel.close();
      }

      /* should probably wait for close, but it doesn't seem to fire properly */

      getChannel.timeout = 5000;
      getChannel.addEventListener(Event.CONNECT, onGetChannelConnect);
      getChannel.addEventListener(ProgressEvent.SOCKET_DATA, onGetChannelData);
      getChannel.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
      getChannel.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

      postChannel = new Socket();
      postChannel.timeout = 5000;
      postChannel.addEventListener(Event.CONNECT, onPostChannelConnect);
      postChannel.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
      postChannel.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

      getChannelData = new ByteArray();
      postChannelData = new ByteArray();
