I have a application that needs to send a small udp packet to port 5000 of the same device.
When on my dev pc there is no problem at all, but when using any other pc (tested with 4 different devices - pc & notebook, the application is published and installed, visual studio is not installed on these devices) no package gets sent.
The pcs have their firewall disabled and are running windows 10/11. The application is programmed in c# uwp.
Following code is used. The code is from Microsoft.com
public static void SendUdpCommand(string msg)
{
try
{
UdpClient uc = new UdpClient();
uc.Connect(IPAddress.Loopback, 5000);
byte[] b = Encoding.UTF8.GetBytes(msg);
uc.Send(b, b.Length);
uc.Close();
uc = null;
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
There is no error in the whole application. It seems kinda like the issue lies with windows or something.
Thanks in advance