         engine = SocketEngine(client: self, opts: opts)
     }
     
+    private func clearReconnectTimer() {
+        reconnectTimer?.invalidate()
+        reconnectTimer = nil
+    }
+    
     /**
     Closes the socket. Only reopen the same socket if you know what you're doing.
     Will turn off automatic reconnects.

    // We lost connection and should attempt to reestablish
    @objc private func tryReconnect() {
        if reconnectAttempts != -1 && currentReconnectAttempt + 1 > reconnectAttempts || !reconnects {
            didDisconnect("Reconnect Failed")
            return
        } else if connected {
            _connecting = false

        _connecting = false
        _reconnecting = false
        currentReconnectAttempt = 0
        clearReconnectTimer()
        
        // Don't handle as internal because something crazy could happen where
        // we disconnect before it's handled
