Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Adding more log to understand what is happening, and remove null task…
…s from whenany to avoid an exception and closing the app
  • Loading branch information
thaystg authored Oct 11, 2022
commit 732cfcc19db29b7ddd259e6d36818650de847341
3 changes: 2 additions & 1 deletion src/mono/wasm/debugger/BrowserDebugProxy/DevToolsProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private async Task<string> ReadOne(WebSocket socket, CancellationToken token)
WebSocketReceiveResult result = await socket.ReceiveAsync(new ArraySegment<byte>(buff), token);
if (result.MessageType == WebSocketMessageType.Close)
{
Log("error", $"DevToolsProxy: Client initiated close: {result.CloseStatus.Value} - {result.CloseStatusDescription}");
client_initiated_close.TrySetResult();
return null;
}
Expand Down Expand Up @@ -257,7 +258,7 @@ public async Task Run(Uri browserUri, WebSocket ideSocket)
{
while (!x.IsCancellationRequested)
{
Task task = await Task.WhenAny(pending_ops.ToArray());
Task task = await Task.WhenAny(pending_ops.Where(i => i != null).ToArray());

if (client_initiated_close.Task.IsCompleted)
{
Expand Down