From e189fa2461f80ba87d6d81f21776b14ad6a84973 Mon Sep 17 00:00:00 2001 From: RogueException Date: Thu, 26 Nov 2015 20:51:16 -0400 Subject: [PATCH] Ignore UDP errors in VoiceSocket's outgoing thread, and push them to the log. --- src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs b/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs index fa416d038..7287f477e 100644 --- a/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs +++ b/src/Discord.Net/Net/WebSockets/VoiceWebSocket.cs @@ -388,7 +388,14 @@ namespace Discord.Net.WebSockets { if (hasFrame) { - _udp.Send(voicePacket, rtpPacketLength); + try + { + _udp.Send(voicePacket, rtpPacketLength); + } + catch (SocketException ex) + { + RaiseOnLog(LogMessageSeverity.Error, "Failed to send UDP packet.", ex); + } hasFrame = false; } nextTicks += ticksPerFrame;