From 4716af0edb613907b3260bc9a93d7e0b28377a37 Mon Sep 17 00:00:00 2001 From: JamJar00 Date: Sun, 1 May 2016 23:50:08 +0100 Subject: [PATCH] Added exception catch --- Hazel/UdpClientConnection.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Hazel/UdpClientConnection.cs b/Hazel/UdpClientConnection.cs index b5516c4..000e803 100644 --- a/Hazel/UdpClientConnection.cs +++ b/Hazel/UdpClientConnection.cs @@ -188,6 +188,10 @@ namespace Hazel { HandleDisconnect(new HazelException("A Socket exception occured while initiating a receive operation.", e)); } + catch (ObjectDisposedException) + { + throw new HazelException("Could not begin read as the socket has been disposed of."); + } if (buffer != null) InvokeDataReceived(new DataEventArgs(buffer, sendOption)); -- 2.39.5