diff options
| author | Bond-009 <bond.009@outlook.com> | 2021-03-01 18:51:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-01 18:51:09 +0100 |
| commit | c2af32d035352d333c3e2852d25fde51f984006b (patch) | |
| tree | e01cb055fa19cd367174afb4e91062abd2de2da6 /Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs | |
| parent | 557a2ad7158b14ae97fa503a551ed17251b97ca0 (diff) | |
| parent | 2bc1eef4ddb23385f90c8bfc6af2ecf9888d7879 (diff) | |
Merge pull request #5299 from Bond-009/tests13
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs')
| -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() { |
