0

I have a really weird issue with communication between server and client using UDP protocol. Client is written in Mono2x (I use Unity 3D as my client) and creates UdpClient class instance:

        _udpClient = new UdpClient(9050);
        _serverEP = new IPEndPoint(IPAddress.Parse(_serverIp), _serverPort);

My server is UWP application I want to run on Raspberry Pi that is using DatagramSocket:

        _udpServer = new DatagramSocket();
        _udpServer.MessageReceived += ClientCheck;
        await _udpServer.BindServiceNameAsync(port.ToString());

I send data from client to server but with no luck. I checked with TCPView that data is send from my client application but never reaches the server. And now is the weird part. When I receive message from server first (I hardcode port to client), my client is able to send data with a success.

I am using same IPEndPoint to send data from client without any changes after receiving packet from server, it just starts working. Honestly, I have no idea what I could do wrong, so I will be thankful for any advice.

1 Answers1

0

And now is the weird part. When I receive message from server first (I hardcode port to client), my client is able to send data with a success

This is a known issue which is filed based on this related question: https://stackoverflow.com/a/39767527/5254458

It includes the issue's description and temporary workaround.

The corresponding is team is investigating it and I can not guarantee that when the fix will be delivered.

Community
  • 1
  • 1
Franklin Chen - MSFT
  • 4,845
  • 2
  • 17
  • 28