Пример #1
0
 private static void HandleConnect(WebSocket clientSocket)
 {
     Console.WriteLine("Connection from " + clientSocket.RemoteEndpoint);
     var client = new AuthClient(clientSocket);
     var apiController = new ApiController(clientSocket)
     {
         //set the auth Client so we can use it later
         authClient = client
     };
     AllClients.AddOrUpdate(client.GetHashCode().ToString(), client, (key, value) => value);
     ApiControllers.AddOrUpdate(apiController.authClient.GetHashCode().ToString(), apiController,
         (key, value) => value);
     SendWelcomeMessage(clientSocket);
 }
Пример #2
0
 private static AuthClient AddTerminalClient(WebSocket ws)
 {
     var client = new AuthClient(ws);
     TerminalClients.AddOrUpdate(client.GetHashCode().ToString(), client, (key, value) => value);
     return client;
 }