diff --git a/src/Discord.Net.Audio/AudioClient.cs b/src/Discord.Net.Audio/AudioClient.cs index bbe6833f9..2f21ce7f8 100644 --- a/src/Discord.Net.Audio/AudioClient.cs +++ b/src/Discord.Net.Audio/AudioClient.cs @@ -230,7 +230,7 @@ namespace Discord.Audio SendVoiceUpdate(channel.Server.Id, channel.Id); 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) diff --git a/src/Discord.Net.Audio/Net/VoiceSocket.cs b/src/Discord.Net.Audio/Net/VoiceSocket.cs index adb583f1d..544a7d710 100644 --- a/src/Discord.Net.Audio/Net/VoiceSocket.cs +++ b/src/Discord.Net.Audio/Net/VoiceSocket.cs @@ -371,7 +371,7 @@ namespace Discord.Net.WebSockets break; } } - await _udp.SendAsync(pingPacket, pingPacket.Length); + await _udp.SendAsync(pingPacket, pingPacket.Length).ConfigureAwait(false); 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 private async Task WatcherAsync() { - await CancelToken.Wait(); + await CancelToken.Wait().ConfigureAwait(false); _udp.Close(); } #endif diff --git a/src/Discord.Net/MessageQueue.cs b/src/Discord.Net/MessageQueue.cs index eaad53bd3..f9dcfc445 100644 --- a/src/Discord.Net/MessageQueue.cs +++ b/src/Discord.Net/MessageQueue.cs @@ -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) { } @@ -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) { } @@ -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) { }