     // Socket to relay.
     private var s_r:Socket;
 
-    // Parent swfcat, for UI updates.
+    // Parent swfcat, for UI updates and rate meter.
     private var ui:swfcat;
+
+    // Pending byte read counts for relay and client sockets.
+    private var r2c_schedule:Array;
+    private var c2r_schedule:Array;
+    // Callback id.
+    private var flush_id:uint;
 
     public function log(msg:String):void
     {

import flash.events.SecurityErrorEvent;
import flash.net.Socket;
import flash.utils.ByteArray;

/* An instance of a client-relay connection. */
class ProxyPair extends EventDispatcher

        // Milliseconds.
        private const FACILITATOR_POLL_INTERVAL:int = 10000;

        // Bytes per second.
        public const RATE_LIMIT:Number = 10 * 1024;
        // Seconds.
        private const RATE_LIMIT_HISTORY:Number = 5.0;

        // Socket to facilitator.
        private var s_f:Socket;

