 
       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));
+    }
   }
 }

package com.axis.rtspclient {
  import com.axis.http.auth;
  import com.axis.http.request;
  import com.axis.http.url;

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

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

        getChannel.removeEventListener(Event.CONNECT, onGetChannelConnect);
        getChannel.removeEventListener(ProgressEvent.SOCKET_DATA, onGetChannelData);
        getChannel.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
        getChannel.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
      }
      if (postChannel.connected) {
        postChannel.close();

        postChannel.removeEventListener(Event.CONNECT, onPostChannelConnect);
        postChannel.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
        postChannel.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
      }

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