mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-25 15:08:37 +02:00
Update Emby.Server.Implementations/Networking/NetworkManager.cs
Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
parent
3a5333228f
commit
455e464445
|
@ -114,11 +114,9 @@ namespace Emby.Server.Implementations.Networking
|
||||||
public int GetRandomUnusedUdpPort()
|
public int GetRandomUnusedUdpPort()
|
||||||
{
|
{
|
||||||
var localEndPoint = new IPEndPoint(IPAddress.Any, 0);
|
var localEndPoint = new IPEndPoint(IPAddress.Any, 0);
|
||||||
var udpClient = new UdpClient(localEndPoint);
|
using (var udpClient = new UdpClient(localEndPoint))
|
||||||
using (udpClient)
|
|
||||||
{
|
{
|
||||||
var port = ((IPEndPoint)udpClient.Client.LocalEndPoint).Port;
|
return ((IPEndPoint)udpClient.Client.LocalEndPoint).Port;
|
||||||
return port;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue