 
     // MARK: - Block based API.
 
-    public var onConnect: ((Void) -> Void)?
+    public var onConnect: (() -> Void)?
     public var onDisconnect: ((NSError?) -> Void)?
     public var onText: ((String) -> Void)?
     public var onData: ((Data) -> Void)?

            let milliseconds = Int(seconds * 1_000)
            callbackQueue.asyncAfter(deadline: .now() + .milliseconds(milliseconds)) { [weak self] in
                self?.disconnectStream(nil)
            }
            fallthrough
        case .none:
            writeError(closeCode)
        default:
            disconnectStream(nil)
            break
        }
    }

    private var certValidated = false
    private var didDisconnect = false
    private var readyToWrite = false
    private let readyToWriteMutex = NSLock()
    private let notificationCenter = NotificationCenter.default
    private var canDispatch: Bool {
        readyToWriteMutex.lock()
        let canWork = readyToWrite
        readyToWriteMutex.unlock()
        return canWork
    }
    /// The shared processing queue used for all WebSocket.
