コード例 #1
0
 private void SendHeader()
 {
     handshake = new ClientHandshake { Version = "8", Origin = Origin, Host = host, Key = GenerateKey(), ResourcePath = path, SubProtocols = SubProtocols };
     client.Client.Send(Encoding.UTF8.GetBytes(handshake.ToString()));
 }
コード例 #2
0
ファイル: WebSocketClient.cs プロジェクト: jabbo/Jabbo
        private void Authenticate()
        {
            _handshake = new ClientHandshake { Version = "8", Origin = Origin, Host = _host, Key = GenerateKey(), ResourcePath = _path, SubProtocols = SubProtocols};

            _client.Client.Send(Encoding.UTF8.GetBytes(_handshake.ToString()));
        }
コード例 #3
0
        private void Authenticate()
        {
            _handshake = new ClientHandshake { Version = "8", Origin = Origin, Host = _host, Key = GenerateKey(), ResourcePath = _path, SubProtocols = SubProtocols};

            // mjb
            //_client.Client.Send(Encoding.UTF8.GetBytes(_handshake.ToString()));

            if (_context.SslStream != null)
            {
                SslStream ns = _context.SslStream;
                byte[] buffer = Encoding.UTF8.GetBytes(_handshake.ToString());
                ns.Write(buffer, 0, buffer.Length);
            }
            else
            {
                _client.Client.Send(Encoding.UTF8.GetBytes(_handshake.ToString()));
            }
        }