     }
     
     public func disconnect() {
-        self.webSocket.disconnect()
+        self.webSocket?.disconnect()
         self.subscriptions.removeAll()
         self.subscribers.removeAll()
     }

            }
            
            self.webSocket = WebSocket(request: request)
            self.webSocket.delegate = self
            self.webSocket.connect()
        }
        catch {
            return nil


open class WebSocketClient {
    let queue: DispatchQueue
    public var webSocket: WebSocket?
    public var delegate: WebSocketClientDelegate?
    private var subscribers = [String: WebSocketCompletionBlock]()
    private var subscriberType = [String: Decodable.Type]()
