Exemplo n.º 1
0
 /// <summary>
 /// Send an upgrade response to the client on successful connection.
 /// </summary>
 public override void HandleClientRequestingConnection(object sender, ClientRequestingConnectionEventArgs <byte, byte> args)
 {
     base.HandleClientRequestingConnection(sender, args);
     if (args.Request.ShouldAllow)
     {
         args.Client.Stream.Write(ConnectionRequest.WriteResponse(clientKeys [args.Client]));
     }
     if (args.Request.ShouldDeny && clientKeys.ContainsKey(args.Client))
     {
         clientKeys.Remove(args.Client);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Send an upgrade response to the client on successful connection.
 /// </summary>
 public override void HandleClientRequestingConnection(object sender, ClientRequestingConnectionEventArgs <byte, byte> args)
 {
     base.HandleClientRequestingConnection(sender, args);
     if (args.Request.ShouldAllow)
     {
         args.Client.Stream.Write(ConnectionRequest.WriteResponse(clientKeys [args.Client]));
         Logger.WriteLine("WebSockets: client connection accepted (" + args.Client.Address + ")");
     }
     if (args.Request.ShouldDeny && clientKeys.ContainsKey(args.Client))
     {
         clientKeys.Remove(args.Client);
     }
 }