mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-26 03:57:12 +00:00
update socket methods
This commit is contained in:
@@ -203,19 +203,6 @@ namespace Emby.Server.Implementations.Udp
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops this instance.
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
{
|
||||
_isDisposed = true;
|
||||
|
||||
if (_udpClient != null)
|
||||
{
|
||||
_udpClient.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Releases unmanaged and - optionally - managed resources.
|
||||
/// </summary>
|
||||
@@ -224,7 +211,12 @@ namespace Emby.Server.Implementations.Udp
|
||||
{
|
||||
if (dispose)
|
||||
{
|
||||
Stop();
|
||||
_isDisposed = true;
|
||||
|
||||
if (_udpClient != null)
|
||||
{
|
||||
_udpClient.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,9 +239,13 @@ namespace Emby.Server.Implementations.Udp
|
||||
|
||||
try
|
||||
{
|
||||
await _udpClient.SendAsync(bytes, bytes.Length, remoteEndPoint, CancellationToken.None).ConfigureAwait(false);
|
||||
await _udpClient.SendWithLockAsync(bytes, bytes.Length, remoteEndPoint, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
_logger.Info("Udp message sent to {0}", remoteEndPoint);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user