my apologies if this is a trivial question.
I've recently begun doing some android programming and I'm writing a simple app that allows you to use your android device as a controller for your windows PC. Specifically it allows the user to do things like turn off the machine, make it sleep, reboot it etc etc. I'm currently using a python library called CherryPy as a server on the windows machine to execute the actual win32api calls to perform the desired function. What i'm not sure about is how to discover (dynamically) which machine on the network is actually hosting the server. Everything is working fine if I hardcode my machines public IP into the android app, but obviously that is far less than ideal. I've considered having the user manually enter their machines public IP in the app, but if there's a way to, say, broadcast a quick message to all machines on the WiFi and check for a pre-canned response that my Python server would send out, that'd be wonderful. Is that possible?
Thanks in advance guys.
You can use the net send command to send messages to other computers on your network. The command is used through the Command Prompt. You can open the Command Prompt from the Start menu or by pressing ⊞ Win + R and typing "cmd".
Broadcast texting is the process of sending mass text messages to a bulk list of recipients. Broadcast messages show up as texts from a dedicated phone number or shortcode (a five or six-digit number that works like a phone number) used by campaigns and organizations for text messages.
example: msg * - This will send the message to everyone on the server. msg username - sends message to the particular user. msg @filename - Useful in group messaging, “filename” is the file which contain all the Usernames/Sessions/Session ID's that you want the message delivered to.
You can use the special address of 255.255. 255.255 to send a broadcast message to every computer on the local network. For more info see section IP Network Broadcasting.
Try sending a UDP packet to the special broadcast address 255.255.255.255. Every device in the network should receive a copy of that packet (barring firewalls), and you can arrange to have the server reply to the packet with its identity.
Write your app using the alljoyn framework. AllJoyn will handle these details for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With