private void ConnectSocket(WebSocket webSocket)
        {
            try
            {
                webSocket.OnOpen += (sender, args) => this.OnOpen(webSocket);
                webSocket.OnMessage += (sender, args) => this.OnMessage(args.RawData);
                webSocket.OnClose += (sender, args) => this.OnClose(args.WasClean);

                webSocket.Connect();
            }
            catch (Exception)
            {
                webSocket.Dispose();
                throw;
            }
        }