public void Open(string url, string protocol = null)
 {
     _clientWebSocketConnection = ClientWebSocketWrapper.Create(url);
     _clientWebSocketConnection.OnConnect(_ => OnOpened?.Invoke());
     _clientWebSocketConnection.OnDisconnect(_ => OnClosed?.Invoke());
     _clientWebSocketConnection.OnMessage((s, _) => OnMessage?.Invoke(s));
     _clientWebSocketConnection.Connect().Wait();
 }
 public void Open(string url, string protocol = null)
 {
     _clientWebSocketConnection = ClientWebSocketWrapper.Create(url);
     _clientWebSocketConnection.OnConnect(_ => OnOpened?.Invoke());
     _clientWebSocketConnection.OnDisconnect(_ => OnClosed?.Invoke());
     _clientWebSocketConnection.OnMessage((s, _) => OnMessage?.Invoke(s));
     _clientWebSocketConnection.Connect().Wait();
 }