Added a few missing ConfigureAwait(false)

This commit is contained in:
RogueException
2016-02-21 23:15:53 -04:00
parent 0ec7218ad0
commit ce8e69d83c
3 changed files with 6 additions and 6 deletions

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)

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

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) { }