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()
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user