aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
diff options
context:
space:
mode:
authorPatrick Barron <18354464+barronpm@users.noreply.github.com>2021-05-10 09:05:12 -0400
committerGitHub <noreply@github.com>2021-05-10 09:05:12 -0400
commite55f35b62e5da535bfba301e5ac86f28df35dd2e (patch)
tree02c1d449788be00877e3f53acde17638eadfc90a /Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
parent9413d974f3f234dd3fc2225d318d7fced7257912 (diff)
parentd4a50be22c3c4b9bb0adfb957ee558287fd219d9 (diff)
Merge branch 'master' into using-declarations
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs')
-rw-r--r--Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
index a12a6b26c..3624e079f 100644
--- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
@@ -1,5 +1,6 @@
#nullable enable
+using System;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
@@ -51,6 +52,8 @@ namespace Emby.Server.Implementations.EntryPoints
/// <inheritdoc />
public Task RunAsync()
{
+ CheckDisposed();
+
try
{
_udpServer = new UdpServer(_logger, _appHost, _config);
@@ -64,6 +67,14 @@ namespace Emby.Server.Implementations.EntryPoints
return Task.CompletedTask;
}
+ private void CheckDisposed()
+ {
+ if (_disposed)
+ {
+ throw new ObjectDisposedException(this.GetType().Name);
+ }
+ }
+
/// <inheritdoc />
public void Dispose()
{