diff options
| author | Bond_009 <bond.009@outlook.com> | 2021-02-23 16:45:10 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2021-02-23 16:45:10 +0100 |
| commit | acac21d8dc3eb9383136ff692606dc2f65adf405 (patch) | |
| tree | 78b2010fa29079a503df1c281502a2c5518a657b /Emby.Server.Implementations/EntryPoints | |
| parent | aff0aea60fc52a2253f04749f11bcb02f6e1f67c (diff) | |
Improve tests
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints')
| -rw-r--r-- | Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs | 11 |
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() { |
