private void WebSocketClient_ConnectedEvent(object sender, ConnectionEventArgs e)
        {
            try
            {
                _parser = new EndpointDataParser((IPEndPoint)e.RemoteEndPoint, (IPEndPoint)e.LocalEndPoint);
                _parser.FirstConnected = true;

                var rnd      = new Random(DateTime.Now.Millisecond);
                var rndBytes = new byte[16];
                rnd.NextBytes(rndBytes);
                _parser.SentKey = Convert.ToBase64String(rndBytes);

                var retStr = $"GET {_path} HTTP/1.1\r\n";
                retStr += "Upgrade: websocket\r\n";
                retStr += "Connection: Upgrade\r\n";
                retStr += $"Sec-WebSocket-Key: {_parser.SentKey}\r\n";
                retStr += $"Sec-WebSocket-Version: 13\r\n\r\n";
                Write(Encoding.UTF8.GetBytes(retStr));
            }
            catch (Exception exception)
            {
                OnErrorEvent(exception);
            }
        }
 private void WebSocketClient_DisconnectedEvent(object sender, EventArgs e)
 {
     _parser = null;
 }