 
     func mqttDidReceivePong(_ mqtt: CocoaMQTT)
 
-    func mqttDidDisconnect(_ mqtt: CocoaMQTT, withError err: NSError?)
+    func mqttDidDisconnect(_ mqtt: CocoaMQTT, withError err: Error?)
 
 }
 

    }

    //AsyncSocket Delegate

    open func socket(_ sock: GCDAsyncSocket, didConnectToHost host: String, port: UInt16) {
        #if DEBUG
            NSLog("CocoaMQTT: connected to \(host) : \(port)")
        #endif

            reader!.payloadReady(data)
        }
    }
    
    public func socketDidDisconnect(_ sock: GCDAsyncSocket, withError err: Error?) {
        connState = CocoaMQTTConnState.disconnected
        delegate?.mqttDidDisconnect(self, withError: err)
    }
