 
     private function send_stream_peer_connect(peer:NetStream):Boolean
     {
+        puts("RTMFPSocket: peer connecting...");
         recv_stream = new NetStream(circon, peer.farID);
         var client:RTMFPSocketClient = new RTMFPSocketClient();
         client.addEventListener(ProgressEvent.SOCKET_DATA, function (event:ProgressEvent):void {
             dispatchEvent(event);
         }, false, 0, true);
         client.addEventListener(RTMFPSocketClient.PEER_CONNECT_ACKNOWLEDGED, function (event:Event):void {
+            puts("RTMFPSocket: peer connected");
+            connected = true;
             dispatchEvent(new Event(Event.CONNECT));
         }, false, 0, true);
         recv_stream.client = client;


        private static const DEFAULT_CIRCON_TIMEOUT:uint = 4000;

        /* TextField for debug output. */
        private var output_text:TextField;


            }
        }

        private function rcp_connect_event(e:Event):void
        {
            puts("RTMFPConnectionPair connected");

            rcp_pairs++;

            if(proxy_mode) {

            } else {
                /* Setup listening RTMFPConnectionPair. */
                if(rcp_pairs < MAXIMUM_RCP_PAIRS) {
                    puts("Setting up listening RTMFPConnectionPair");
                    var rcp:RTMFPConnectionPair = new RTMFPConnectionPair(circon, tor_addr, output_text);
                    rcp.addEventListener(Event.CONNECT, rcp_connect_event);
                    rcp.addEventListener(Event.CLOSE, rcp_close_event);
                    rcp.listen();
                }
            }
        }

        private function rcp_close_event(e:Event):void
        {
            puts("RTMFPConnectionPair closed");

            rcp_pairs--;

            /* FIXME: Do I need to unregister the event listeners so
             * that the system can garbage collect the rcp object? */
        }

        private function register_id(id:String, fac_addr:Object):void
