I have an application (written in C / C ++) that transmits UDP between many Windows and Linux hosts on a local network (via winsock / Linux-Sockets). I use only one port, and only one Socket on each host. Some messages are Broadcastet, responses are often unicast, but some are also broadcast. Everthing still works, but:
How can I find out if I received Paket (via recvfrom) broadcast or unicast?
The only solution I found was to send this information inside the payload or use different ports. Both are not very pleasant ...
source
share