 			this.connectMesage.writeByte(0x02); //String length LSB = 2
 			this.connectMesage.writeByte(0x4d); //M
 			this.connectMesage.writeByte(0x70); //P .. Let's say client ID = MP
-			//for subscribe: subscribes to topics */
-			
+			//for disconnect
+			this.disconnectMessage.writeByte(0x0E); //Disconnect
+			this.disconnectMessage.writeByte(0x00); //Disconnect
 			//for publish
 			this.publishMessage.writeByte(0x30); //Publish with QOS 0
 			this.publishMessage.writeByte(0x05 + 0x05); //Remaining length

		//
		//--------------------------------------------------------------------------
		private var mqttSocket:Socket;
		//First let's construct the MQTT messages that need to be sent:
		private var connectMesage:ByteArray=new ByteArray();
		private var publishMessage:ByteArray=new ByteArray();
		private var subscribeMessage:ByteArray=new ByteArray();
		private var disconnectMessage:ByteArray=new ByteArray();
		//----------------------------------
		//  CONSTANTS
		//----------------------------------

	import flash.net.Socket;
	import flash.system.Security;
	import flash.utils.ByteArray;
	import flash.utils.Endian;

	/**
	 * Pure Action Script 3 that implements the MQTT (Message Queue Telemetry Transport) protocol, a lightweight protocol for publish/subscribe messaging. </br>
