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

      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();
