             errorMsg.rootCause = event;
             ps.agent.fault(errorMsg, pendingMsg);
         }
+    }    
+    
+    /**
+     *  Redispatches message events from the currently connected Channel.
+     * 
+     *  @param event The MessageEvent from the Channel.
+     */
+    protected function messageHandler(event:MessageEvent):void
+    {
+        dispatchEvent(event);
+    }    
+    
+    //--------------------------------------------------------------------------
+    //
+    // Private Methods
+    // 
+    //--------------------------------------------------------------------------    
+    
+    /**
+     *  @private
+     *  Helper method to connect the current internal Channel.
+     */
+    private function connectChannel():void
+    {
+        if (!connected && !_connecting)
+        {
+            _connecting = true;
+            _currentChannel.connect(this);
+            // Listen for any server pushed messages on the Channel.
+            _currentChannel.addEventListener(MessageEvent.MESSAGE, messageHandler);
+        }
+    }
+    
+    /**
+     *  @private
+     *  Helper method to disconnect the current internal Channel.
+     */
+    private function disconnectChannel():void
+    {
+        _connecting = false;        
+        // Stop listening for server pushed messages on the Channel.
+        _currentChannel.removeEventListener(MessageEvent.MESSAGE, messageHandler);
+        _currentChannel.disconnect(this);
+    }
+    
+    /**
+     *  @private
+     *  Helper method to dispatch authentication-related RPC events.
+     * 
+     *  @param event The event to dispatch.
+     */
+    private function dispatchRPCEvent(event:AbstractEvent):void
+    {
+        event.callTokenResponders();
+        dispatchEvent(event);
+    }
+    
+    /**
+     *  @private
+     *  Helper method to hunt to the next available internal Channel for the
+     *  ChannelSet.
+     * 
+     *  @return True if hunting to the next available Channel was successful; false if hunting
+     *          exhausted available channels and has reset to the beginning of the set.
+     * 
+     *  @throws mx.messaging.errors.NoChannelAvailableError If the ChannelSet has no internal
+     *                                  Channels to use.
+     */
+    private function hunt():Boolean
+    {
+        if (_channels.length == 0)
+        {
+            var message:String = resourceManager.getString(
+                "messaging", "noAvailableChannels");
+            throw new NoChannelAvailableError(message);
+        }
+        
+        // Advance to next channel, and reset to beginning if all Channels in the set
+        // have been attempted.
+        if (++_currentChannelIndex >= _channels.length)
+        {
+            _currentChannelIndex = -1;
+            return false;
+        }       
+        
+        // If we've advanced past the first channel, indicate that we're hunting.
+        if (_currentChannelIndex > 0)
+            _hunting = true;
+        
+        // Set current channel.              
+        if (configured)
+        {           
+            if (_channels[_currentChannelIndex] != null)
+            {
+                _currentChannel = _channels[_currentChannelIndex];   
+            }
+            else
+            {
+                _currentChannel = ServerConfig.getChannel(_channelIds[
+                                        _currentChannelIndex], _clustered);
+                _currentChannel.setCredentials(_credentials);
+                _channels[_currentChannelIndex] = _currentChannel;
+            }
+        }
+        else
+        {            
+            _currentChannel = _channels[_currentChannelIndex];
+        }
+        
+        // Ensure that the current channel is assigned failover URIs it if was lazily instantiated.
+        if ((_channelFailoverURIs != null) && (_channelFailoverURIs[_currentChannel.id] != null))
+            _currentChannel.failoverURIs = _channelFailoverURIs[_currentChannel.id];
+        
+        return true;
+    }
+    
+    /**
+     *  @private
+     *  This method is invoked by a timer and it works around a reconnect issue 
+     *  with NetConnection based channels within a single frame by reconnecting after a slight delay.
+     */
+    private function reconnectChannel(event:TimerEvent):void
+    {
+        _reconnectTimer.stop();
+        _reconnectTimer.removeEventListener(TimerEvent.TIMER, reconnectChannel);
+        _reconnectTimer = null;
+        connectChannel();        
     }
 }
 

    //--------------------------------------------------------------------------        
    
    /**
     *  Redispatches message events from the currently connected Channel.
     * 
     *  @param event The MessageEvent from the Channel.
     */
    protected function messageHandler(event:MessageEvent):void
    {
        dispatchEvent(event);
    }    
    
    //--------------------------------------------------------------------------
    //
    // Private Methods
    // 
    //--------------------------------------------------------------------------    
    
    /**
     *  @private
     *  Helper method to connect the current internal Channel.
     */
    private function connectChannel():void
    {
        if (!connected && !_connecting)
        {
            _connecting = true;
            _currentChannel.connect(this);
            // Listen for any server pushed messages on the Channel.
            _currentChannel.addEventListener(MessageEvent.MESSAGE, messageHandler);
        }
    }
    
    /**
     *  @private
     *  Helper method to disconnect the current internal Channel.
     */
    private function disconnectChannel():void
    {
        _connecting = false;        
        // Stop listening for server pushed messages on the Channel.
        _currentChannel.removeEventListener(MessageEvent.MESSAGE, messageHandler);
        _currentChannel.disconnect(this);
    }
    
    /**
     *  @private
     *  Helper method to dispatch authentication-related RPC events.
     * 
     *  @param event The event to dispatch.
     */
    private function dispatchRPCEvent(event:AbstractEvent):void
    {
        event.callTokenResponders();
        dispatchEvent(event);
    }
    
    /**
     *  @private
     *  Helper method to hunt to the next available internal Channel for the
     *  ChannelSet.
     * 
     *  @return True if hunting to the next available Channel was successful; false if hunting
     *          exhausted available channels and has reset to the beginning of the set.
     * 
     *  @throws mx.messaging.errors.NoChannelAvailableError If the ChannelSet has no internal
     *                                  Channels to use.
     */
    private function hunt():Boolean
    {
        if (_channels.length == 0)
        {
            var message:String = resourceManager.getString(
                "messaging", "noAvailableChannels");
            throw new NoChannelAvailableError(message);
        }
        
        // Advance to next channel, and reset to beginning if all Channels in the set
        // have been attempted.
        if (++_currentChannelIndex >= _channels.length)
        {
            _currentChannelIndex = -1;
            return false;
        }       
        
        // If we've advanced past the first channel, indicate that we're hunting.
        if (_currentChannelIndex > 0)
            _hunting = true;
        
        // Set current channel.              
        if (configured)
        {           
            if (_channels[_currentChannelIndex] != null)
            {
                _currentChannel = _channels[_currentChannelIndex];   
            }
            else
            {
                _currentChannel = ServerConfig.getChannel(_channelIds[
                                        _currentChannelIndex], _clustered);
                _currentChannel.setCredentials(_credentials);
                _channels[_currentChannelIndex] = _currentChannel;
            }
        }
        else
        {            
            _currentChannel = _channels[_currentChannelIndex];
        }
        
        // Ensure that the current channel is assigned failover URIs it if was lazily instantiated.
        if ((_channelFailoverURIs != null) && (_channelFailoverURIs[_currentChannel.id] != null))
            _currentChannel.failoverURIs = _channelFailoverURIs[_currentChannel.id];
        
        return true;
    }
    
    /**
     *  @private
     *  This method is invoked by a timer and it works around a reconnect issue 
     *  with NetConnection based channels within a single frame by reconnecting after a slight delay.
     */
    private function reconnectChannel(event:TimerEvent):void
    {
        _reconnectTimer.stop();
        _reconnectTimer.removeEventListener(TimerEvent.TIMER, reconnectChannel);
        _reconnectTimer = null;
        connectChannel();        
    }
    
    /**
     *  @private
     *  Helper method to fault pending messages. 
     *  The ErrorMessage is tagged with a __retryable__ header to indicate that 

     *  @param event A ChannelEvent.DISCONNECT or a ChannelFaultEvent that is the root cause
     *               for faulting these pending sends.
     */
    protected function faultPendingSends(event:ChannelEvent):void
    {
        while (_pendingSends.length > 0)
        {
