     fileprivate var pingpong: PingPong?
     
     // auto reconnect
-    public var retrySetting: (retry: Bool, maxCount: UInt, step: TimeInterval) = (true, 10, 1.2) {
+    public var retrySetting: (retry: Bool, maxCount: UInt, step: TimeInterval, fusingDepth: UInt, fusingDuration: TimeInterval) = (true, 10, 1.2, 60, 60) {
         didSet {
-            retry = Retry(retry: retrySetting.retry, maxRetryCount: retrySetting.maxCount, step: retrySetting.step)
+            retry = Retry(retry: retrySetting.retry, maxRetryCount: retrySetting.maxCount, step: retrySetting.step, fusingDepth: retrySetting.fusingDepth, fusingDuration: retrySetting.fusingDuration)
         }
     }
     public var retrying: Bool { return retry.retrying }

    public func socketDidDisconnect(_ sock: GCDAsyncSocket, withError err: Error?) {
        printNotice("AsyncSock didDisconect. Error: \(String(describing: err))")
        
        pingpong?.reset()
        socket.delegate = nil
        connState = .disconnected
        delegate?.mqttDidDisconnect(self, withError: err)

        DispatchQueue.main.async { [weak self] in
            if self?.disconnectExpectedly == false {
                self?.retry.start { self?.internal_connect() }
            } else {
                self?.retry.reset()
            }
        }
    }
}


    public func connect() -> Bool {
        printNotice("connect")
        retry.reset()
        retry.resetFusing()
        return internal_connect()
    }
    
