mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
Update Emby.Server.Implementations/Networking/NetworkManager.cs
Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
@@ -114,11 +114,9 @@ namespace Emby.Server.Implementations.Networking
|
||||
public int GetRandomUnusedUdpPort()
|
||||
{
|
||||
var localEndPoint = new IPEndPoint(IPAddress.Any, 0);
|
||||
var udpClient = new UdpClient(localEndPoint);
|
||||
using (udpClient)
|
||||
using (var udpClient = new UdpClient(localEndPoint))
|
||||
{
|
||||
var port = ((IPEndPoint)udpClient.Client.LocalEndPoint).Port;
|
||||
return port;
|
||||
return ((IPEndPoint)udpClient.Client.LocalEndPoint).Port;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user