Skip to content

Commit

Permalink
WebSocket: Handle Win32Exception in RecieveAsync.
Browse files Browse the repository at this point in the history
Fixes #420 (weed joke goes here)
  • Loading branch information
yaakov-h committed Jul 29, 2017
1 parent abae754 commit 5323403
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SteamKit2/SteamKit2/Networking/Steam3/WebSocketContext.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Net.Sockets;
Expand Down Expand Up @@ -132,6 +133,11 @@ async Task<byte[]> ReadMessageAsync(CancellationToken cancellationToken)
DisconnectNonBlocking(userInitiated: cancellationToken.IsCancellationRequested);
return null;
}
catch (Win32Exception)
{
DisconnectNonBlocking(userInitiated: false);
return null;
}

switch (result.MessageType)
{
Expand Down

0 comments on commit 5323403

Please sign in to comment.