aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
diff options
context:
space:
mode:
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()
{