public static async Task HandleConnection(WebSocket webSocket) { if (HostProcess.Token.IsCancellationRequested) { HostProcess = new HostProcess(); } HostProcess.AddClient(webSocket); var clientSession = new ClientSession(webSocket, HostProcess); try { await clientSession.Process(); } catch (Exception) { // todo } HostProcess.RemoveClient(webSocket); }
public ClientSession(WebSocket webSocket, HostProcess host) { _webSocket = webSocket; _host = host; }