I have to network devices: 1. Server (variable IP) that needs to receive a String for further stuff (e.g. Socket 9999). This server has also another socket (e.g. 8888) where it sends it's device name on pairing. 2. Client (variable IP) that does NOT know the IP of the server but wants to send him the string.
On a IP C-network I could iterate through the last octet (0..255) and check if Socket 8888 transmits something. But on A and B networks I have no chance. Is there any other solution for this? (I could iterate through all four octets but that wouldn't be an elegant solution).
Thank you!
The most appropriate way to do it, if they are in the same LAN is:
With just two network packets you know the IP address.
--EDITED--
To broadcast:
To receice broadcast:
You will need to do some editing but should start you in the right track.