Browse Source

Added a few missing ConfigureAwait(false)

tags/docs-0.9
RogueException 9 years ago
parent
commit
ce8e69d83c
3 changed files with 6 additions and 6 deletions
  1. +1
    -1
      src/Discord.Net.Audio/AudioClient.cs
  2. +2
    -2
      src/Discord.Net.Audio/Net/VoiceSocket.cs
  3. +3
    -3
      src/Discord.Net/MessageQueue.cs

+ 1
- 1
src/Discord.Net.Audio/AudioClient.cs View File

@@ -230,7 +230,7 @@ namespace Discord.Audio


SendVoiceUpdate(channel.Server.Id, channel.Id); SendVoiceUpdate(channel.Server.Id, channel.Id);
using (await _connectionLock.LockAsync().ConfigureAwait(false)) using (await _connectionLock.LockAsync().ConfigureAwait(false))
await Task.Run(() => VoiceSocket.WaitForConnection(CancelToken));
await Task.Run(() => VoiceSocket.WaitForConnection(CancelToken)).ConfigureAwait(false);
} }


private async void OnReceivedEvent(WebSocketEventEventArgs e) private async void OnReceivedEvent(WebSocketEventEventArgs e)


+ 2
- 2
src/Discord.Net.Audio/Net/VoiceSocket.cs View File

@@ -371,7 +371,7 @@ namespace Discord.Net.WebSockets
break; break;
} }
} }
await _udp.SendAsync(pingPacket, pingPacket.Length);
await _udp.SendAsync(pingPacket, pingPacket.Length).ConfigureAwait(false);
nextPingTicks = currentTicks + 5 * ticksPerSeconds; nextPingTicks = currentTicks + 5 * ticksPerSeconds;
} }
} }
@@ -395,7 +395,7 @@ namespace Discord.Net.WebSockets
//Closes the UDP socket when _disconnectToken is triggered, since UDPClient doesn't allow passing a canceltoken //Closes the UDP socket when _disconnectToken is triggered, since UDPClient doesn't allow passing a canceltoken
private async Task WatcherAsync() private async Task WatcherAsync()
{ {
await CancelToken.Wait();
await CancelToken.Wait().ConfigureAwait(false);
_udp.Close(); _udp.Close();
} }
#endif #endif


+ 3
- 3
src/Discord.Net/MessageQueue.cs View File

@@ -144,7 +144,7 @@ namespace Discord.Net
} }
} }
} }
await Task.Delay((int)Discord.DiscordConfig.MessageQueueInterval).ConfigureAwait(false);
await Task.Delay(Discord.DiscordConfig.MessageQueueInterval).ConfigureAwait(false);
} }
} }
catch (OperationCanceledException) { } catch (OperationCanceledException) { }
@@ -178,7 +178,7 @@ namespace Discord.Net
} }
} }
} }
await Task.Delay((int)Discord.DiscordConfig.MessageQueueInterval).ConfigureAwait(false);
await Task.Delay(Discord.DiscordConfig.MessageQueueInterval).ConfigureAwait(false);
} }
} }
catch (OperationCanceledException) { } catch (OperationCanceledException) { }
@@ -211,7 +211,7 @@ namespace Discord.Net
} }
} }


await Task.Delay((int)Discord.DiscordConfig.MessageQueueInterval).ConfigureAwait(false);
await Task.Delay(Discord.DiscordConfig.MessageQueueInterval).ConfigureAwait(false);
} }
} }
catch (OperationCanceledException) { } catch (OperationCanceledException) { }


Loading…
Cancel
Save