How to get response on request to UDP echo server?
Posted: Mon Jun 19, 2017 12:58 pm
It sounds obvious, but it is not =)
Let we have a UDP server with some SRV_IP that listens on some SRV_PORT.
Client creates UDP socket and sends HELLO on SRV_IP:SRV_PORT from randomly selected port CLI_IP:CLI_PORT.
Server gets HELLO and sends it back to client on CLI_IP:CLI_PORT.
And there is a problem:
How to get response from server?
How client should figure out a port number for listening?
Let we have a UDP server with some SRV_IP that listens on some SRV_PORT.
Client creates UDP socket and sends HELLO on SRV_IP:SRV_PORT from randomly selected port CLI_IP:CLI_PORT.
Server gets HELLO and sends it back to client on CLI_IP:CLI_PORT.
And there is a problem:
How to get response from server?
How client should figure out a port number for listening?