Sending a message to all available machines via WiFi

My apologies if this is a trivial question.

I recently started programming on Android, and I'm writing a simple application that allows you to use your Android device as a controller for your Windows PC. In particular, it allows the user to do such things as turn off the machine, make it sleep, restart it, etc. Etc. I am currently using a python library called CherryPy as a server on a Windows computer to make actual win32api calls to execute the required function. I'm not sure how to detect (dynamically) which machine on the network actually hosts the server. Everything works fine if I hard code my public IP address in an Android app, but obviously this is much less than just ideal. I thought that the user manually enters their public IP address of their computers in the application, but if there is a way, say, send a quick message to all the machines in WiFi and check the preprogrammed response that my Python server would send, that would be great. Is it possible?

Thanks in advance guys.

+6
source share
2 answers

Write your application using the alljoyn framework. AllJoyn will process this data for you.

+1
source

Try sending a UDP packet to a special broadcast address 255.255.255.255. Each device on the network should receive a copy of this package (firewall prohibition), and you can organize a server response to the package with its identification.

+2
source

All Articles