     	}
 
     	private function fail(e:Event):void {
+            trace(PREFIX, "Communication failure", e);
+
     	    _socket.close();
     	    _connected = false;
-            trace(PREFIX, "Communication failure", e);
     	}
     }
 }


    	   trace(PREFIX, "Connected");
           
           var now:Date = new Date();
           var seconds:uint = now / 1000;

           _socket.writeShort(0x4201);
           _socket.writeUnsignedInt(seconds);
           _socket.writeShort(now - (seconds * 1000));
           _socket.writeUnsignedInt(getTimer());
           _socket.flush();
    	}
    	
    	private function close(e:Event):void {

    	    _host = loaderInfo.parameters["host"] || HOST;
    	    _port = loaderInfo.parameters["port"] || PORT;
	    
	        _socket = new Socket();

            _socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, fail);
            _socket.addEventListener(IOErrorEvent.IO_ERROR, fail);
