             internalDisconnect();
         }
     }
-    
+
     /**
      *  Handles HTTP status events dispatched by the streaming connection.
-     * 
+     *
      *  @param event The HTTPStatusEvent.
      */
     private function streamHttpStatusHandler(event:HTTPStatusEvent):void
     {
-    	// No-op because most of the times, HTTP status is zero.
-        // See ioErrorHandler.        
-    }
-    
+        // No-op because most of the times, HTTP status is zero.
+        // See ioErrorHandler.
+    }
+
     /**
      *  Handles IO error events dispatched by the streaming connection.
-     * 
+     *
      *  @param event The IOErrorEvent.
      */
     private function streamIoErrorHandler(event:IOErrorEvent):void

            connectFailed(faultEvent);
        }
    }
        
    /**
     *  Handles security error events dispatched by the streaming connection.
     * 
     *  @param event The SecurityErrorEvent.
     */
    private function streamSecurityErrorHandler(event:SecurityErrorEvent):void
    {
		// Just log as we'll never reach this handler because the prior ping will trigger 
        // a security error before we try to establish the streaming connection.    	
    	if (Log.isDebug())
    		_log.debug("'{0}' channel encountered a security error: {1}", id, event.text);    		
    }
    
    /**
     *  Handle status events dispatched by the streaming connection.
     * 
     *  @param event The StatusEvent.
     */
    private function streamStatusHandler(event:StatusEvent):void


        // Disable polling.
        internalPollingEnabled = false;
    }

    //--------------------------------------------------------------------------
    //
    // Variables
    //
    //--------------------------------------------------------------------------

      /**
       * Helper class used by the channel to establish a streaming HTTP connection
       * with the server.
       */
    private var streamingConnectionHandler:StreamingConnectionHandler;

    /**
     *  @private
     */
    private var resourceManager:IResourceManager =
                                    ResourceManager.getInstance();

    //--------------------------------------------------------------------------
    //
    // Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    //  pollingEnabled
    //----------------------------------

    /**
     *  @private
     */
    override public function set pollingEnabled(value:Boolean):void
    {
        var message:String = resourceManager.getString(
            "messaging", "pollingNotSupportedHTTP");
        throw new Error(message);
    }

    //----------------------------------
    //  pollingInterval
    //----------------------------------

    /**
     *  @private
     */
    override public function set pollingInterval(value:Number):void
    {
        var message:String = resourceManager.getString(
            "messaging", "pollingNotSupportedHTTP");
        throw new Error(message);
    }

    //----------------------------------
    //  realtime
    //----------------------------------

    /**
     *  @private
     *  Returns true since streaming channels are considered realtime.
     */
    override mx_internal function get realtime():Boolean
    {
        return true;
    }

    //--------------------------------------------------------------------------
    //
    // Overridden Public Methods
    //
    //--------------------------------------------------------------------------

    /**
     *  Polling is not supported by this channel.
     */
    override public function poll():void
    {
        var message:String = resourceManager.getString(
            "messaging", "pollingNotSupportedHTTP");
        throw new Error(message);
    }

    //--------------------------------------------------------------------------
    //
    // Overriden Protected Methods
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     *  Closes the streaming connection before redispatching the fault event.
     *
     *  @param event The ChannelFaultEvent.
     */
    override protected function connectFailed(event:ChannelFaultEvent):void
    {
        if (streamingConnectionHandler != null)
            streamingConnectionHandler.closeStreamingConnection();

        super.connectFailed(event);
    }

    /**
     *  @private
     *  Closes the streaming connection before disconnecting.
     */
    override protected function internalDisconnect(rejected:Boolean = false):void
    {
        if (streamingConnectionHandler != null)
            streamingConnectionHandler.closeStreamingConnection();

        super.internalDisconnect(rejected);
    }

    /**
     *  @private
     *  This method will be called if the ping message sent to test connectivity
