I have a port that is bind()’d to INADDR_ANY. I am receiving datagrams successfully. After receipt, I need to read the IP header to get the source IP address.
I have a port that is bind()’d to INADDR_ANY. I am receiving datagrams successfully.
Share
I don’t believe you can get it if you’re using the standard recv or read function calls. The recvfrom call as follows:
includes a structure (the second to last field above) which will receive the source address which you can examine for whatever purposes you desire.