aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Net/UdpSocket.cs
diff options
context:
space:
mode:
authoradrez99 <59739805+adrez99@users.noreply.github.com>2022-10-11 18:15:28 +0200
committeradrez99 <adrez99@gmail.com>2022-10-11 18:18:21 +0200
commit3736e360e76fdc44d8069905ba76aec03e69473f (patch)
tree1626fd7da50abf0350ab1b644d6699bd39590dd6 /Emby.Server.Implementations/Net/UdpSocket.cs
parentb8afdd892af01fd99011a6dc3df65cfb762084d6 (diff)
parentd50c1b2d4bc0c85428671b288adef1b336da1156 (diff)
Merge branch 'jellyfin:master' into gzip
Diffstat (limited to 'Emby.Server.Implementations/Net/UdpSocket.cs')
-rw-r--r--Emby.Server.Implementations/Net/UdpSocket.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/Emby.Server.Implementations/Net/UdpSocket.cs b/Emby.Server.Implementations/Net/UdpSocket.cs
index bbbca4fc0..c3994fc04 100644
--- a/Emby.Server.Implementations/Net/UdpSocket.cs
+++ b/Emby.Server.Implementations/Net/UdpSocket.cs
@@ -35,10 +35,7 @@ namespace Emby.Server.Implementations.Net
public UdpSocket(Socket socket, int localPort, IPAddress ip)
{
- if (socket == null)
- {
- throw new ArgumentNullException(nameof(socket));
- }
+ ArgumentNullException.ThrowIfNull(socket);
_socket = socket;
_localPort = localPort;
@@ -51,10 +48,7 @@ namespace Emby.Server.Implementations.Net
public UdpSocket(Socket socket, IPEndPoint endPoint)
{
- if (socket == null)
- {
- throw new ArgumentNullException(nameof(socket));
- }
+ ArgumentNullException.ThrowIfNull(socket);
_socket = socket;
_socket.Connect(endPoint);
@@ -96,7 +90,7 @@ namespace Emby.Server.Implementations.Net
}
else
{
- tcs.TrySetException(new Exception("SocketError: " + e.SocketError));
+ tcs.TrySetException(new SocketException((int)e.SocketError));
}
}
}
@@ -114,7 +108,7 @@ namespace Emby.Server.Implementations.Net
}
else
{
- tcs.TrySetException(new Exception("SocketError: " + e.SocketError));
+ tcs.TrySetException(new SocketException((int)e.SocketError));
}
}
}