     //AsyncSocket Delegate
     
     func socket(sock: GCDAsyncSocket!, didConnectToHost host: String!, port: UInt16) {
+        #if DEBUG
         NSLog("CocoaMQTT: connected to \(host) : \(port)")
+        #endif
         connState = CocoaMQTTConnState.CONNECTED
         let frame = CocoaMQTTFrameConnect(client: self)
         send(frame)

        case .PUBCOMP: descr = "PUBCOMP"
        default: assert(false)
        }
        if descr != nil {
            NSLog("CocoaMQTT: Send \(descr!), msgid: \(msgid)")
        }
        send(CocoaMQTTFramePubAck(type: type, msgid: msgid))
    }

    func didReceivePubAck(reader: CocoaMQTTReader, msgid: UInt16) {
        NSLog("CocoaMQTT: PUBACK Received: \(msgid)")
        if let message = messages[msgid] {
            messages.removeValueForKey(msgid)
            delegate?.mqtt(self, didPublishMessage: message, id: msgid)


    func didReceiveConnAck(reader: CocoaMQTTReader, connack: UInt8) {
        connState = CocoaMQTTConnState.CONNECTED
        #if DEBUG
        NSLog("CocoaMQTT: CONNACK Received: \(connack)")
        #endif
        
        //keep alive
        if keepAlive > 0 {
            aliveTimer = MSWeakTimer.scheduledTimerWithTimeInterval(
