private async Task ProcessWebSocketAsync(HttpContext context) { if (!context.WebSockets.IsWebSocketRequest) { return; } WebSocket ws = await context.WebSockets.AcceptWebSocketAsync(); WebSocketRemoteNode remoteNode = new WebSocketRemoteNode(this, ws, new IPEndPoint(context.Connection.RemoteIpAddress, context.Connection.RemotePort)); OnConnected(remoteNode); }
private async Task ProcessWebSocketAsync(HttpContext context) { TR.Enter(); if (!context.WebSockets.IsWebSocketRequest) { TR.Exit(); return; } IndentContext ic = TR.SaveContextAndShuffle(); WebSocket ws = await context.WebSockets.AcceptWebSocketAsync(); TR.RestoreContext(ic); WebSocketRemoteNode remoteNode = new WebSocketRemoteNode(this, ws, new IPEndPoint(context.Connection.RemoteIpAddress, context.Connection.RemotePort)); OnConnected(remoteNode); TR.Exit(); }