Browse Source

Revert "Do not allow ObjectDisposed exceptions to trigger disconnectreason"

This reverts commit f6dacb7a84.
tags/docs-0.9
Brandon Smith 9 years ago
parent
commit
f0933c75a0
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      src/Discord.Net/DiscordWebSocket.cs

+ 2
- 4
src/Discord.Net/DiscordWebSocket.cs View File

@@ -146,11 +146,11 @@ namespace Discord
if (_webSocket.State != WebSocketState.Open || cancelToken.IsCancellationRequested)
return;

try
try
{
result = await _webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), cancelToken);
}
catch (Win32Exception ex)
catch (Win32Exception ex)
when (ex.HResult == HR_TIMEOUT)
{
string msg = $"Connection timed out.";
@@ -182,7 +182,6 @@ namespace Discord
}
}
catch (OperationCanceledException) { }
catch (ObjectDisposedException) { }
catch (Exception ex) { DisconnectInternal(ex); }
}
private async Task SendAsync()
@@ -211,7 +210,6 @@ namespace Discord
}
}
catch (OperationCanceledException) { }
catch (ObjectDisposedException) { }
catch (Exception ex) { DisconnectInternal(ex); }
}



Loading…
Cancel
Save