feedback report 3 done

This commit is contained in:
2026-09-24 13:12:15 +05:30
parent 5ac8f92006
commit d4c7f5dd46
21 changed files with 11867 additions and 153 deletions
+19
View File
@@ -0,0 +1,19 @@
using System.Net;
using System.Net.Sockets;
public static class GetAvailablePort
{
public static int GetAvailableUdpPort()
{
using var socket = new Socket(
AddressFamily.InterNetwork,
SocketType.Dgram,
ProtocolType.Udp
);
socket.Bind(new IPEndPoint(IPAddress.Any, 0));
return ((IPEndPoint)socket.LocalEndPoint).Port;
}
}