Maui packaged as iOS 17 system failed to send message using udpClient No Route to Host

于晏 彭 5 Reputation points
2024-04-17T02:53:26.8433333+00:00

I have implemented the following code in C#:

IPEndPoint remoteEP = new IPEndPoint(IPAddress.Parse(udpServerIp), udpPort);

udpClient.Send(requestBytes, requestBytes.Length, remoteEP);

However, Packaging it as Android can send UDP messages, when using Maui packaged as iOS 17 system the message fails to send, and I'm getting a "No Route to Host" error. How can I resolve this issue?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,885 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,265 questions
{count} votes