         return true;
     }
 
+    private function circon_netstatus_event(event:NetStatusEvent):void
+    {
+        switch (event.info.code) {
+        case "NetStream.Connect.Closed" :
+            puts("RTMFPSocket: NetStream connection was closed");
+
+            if(connected)
+            {
+                send_stream.close();
+                recv_stream.close();
+                connected = false;
+                dispatchEvent(new Event(Event.CLOSE));
+            }
+
+            break;
+        }
+    }
+
+
     public function readBytes(bytes:ByteArray):void
     {
         recv_stream.client.bytes.readBytes(bytes);

            host: "128.12.179.80",
            port: 9002
        };
       
        /* Cirrus server information. */
        private const DEFAULT_CIRRUS_ADDRESS:String = "rtmfp://p2p.rtmfp.net";

import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import flash.events.NetStatusEvent;
import flash.net.Socket;
import flash.utils.ByteArray;
import flash.utils.clearTimeout;
