Here is an example of using udpclient from .net
private static void UDPListener() { Task.Run(async () => { using (var udpClient = new UdpClient(11000)) { string loggingEvent = ""; while (true) { //IPEndPoint object will allow us to read datagrams sent from any source. var receivedResults = await udpClient.ReceiveAsync(); loggingEvent += Encoding.ASCII.GetString(receivedResults.Buffer); } } }); } I would like to understand how to use an analog from Java.Net.DatagramSocket.ReceiveAsync Alas, almost empty description If not an example, then the logic at least
Receive. That is, takes the data in thepack. (The documentation describes theDatagramPacket packargument, for some reason you don’t have it in the code.) - VladDsocket.ReceiveAsync(packet)starts a normalTask, which asynchronously waits for data, and delivers it to thepacket. - VladD