locked
How to make a broadcast to all devices connected to a network? RRS feed

  • Question

  • User21051 posted

    I need to send and get information like, to all pcs conected to the network and get back all of their Ips for me to know wich one of them is sending me the information i need... i looked for something on restSharp but nothing appeared... does anyone knows how to do this?

    Tuesday, September 24, 2013 2:01 PM

All replies

  • User9089 posted

    In C# VS i had a similar solution. In the LAN C class 192.168.x.x i had a solution. I have a GridView filled with all of the C class IP address from my network(192.168.0.1 - 192.168.0.254). I started some thread. Each thread ping the actual IP. If this thread receive some information from the IP(active computer) than i show this information in the another columns of the GridView(TTL, Status, Host Name, etc.). If a computer is reachable then i color the row's background to green, when unreachable i colored it to red. This works in B class to with Linq. You could filter the rows if you want to search a specified host name or check the IP covers an active computer. You have only a number that how many computer do you waiting for. Then you need to do an "IP searching" to detect how many computers are active already. If it is less then your expection then you need to wait and start again. If you want to send some information to the computer i suggest you to do it with multicasting. You specify a multicast address. You send the information to this address. If a computer need this information join to this multicast address and it get the informations.

    Wednesday, September 25, 2013 12:54 PM
  • User21051 posted

    I actually just need to receive information, like with webservice i need to know what pc to connect to, i need to search in the "air" for some pc that are providing me the services i want and then get its IP so i can work with it. But i need to do with one command something simple with broadcast i dont know... so i would receive just one answer that is the IP of the pc with the service... there's a simple way to do that?

    Wednesday, September 25, 2013 2:05 PM
  • User565 posted

    No. You seem to have no understanding of what a broadcast is.

    It's not like an inventory call, that lists everything in your network.

    Broadcast is just an UDP packet that is send to x.y.z.255 on the network, and the connected PC's might answer.

    If a Service has this kind of functionality, then this is documented.

    If not, you have to populate every IP in the network and try to reach that PC with a Webservice Call.

    Wednesday, September 25, 2013 2:35 PM
  • User21051 posted

    All i want is to click a button an my device to find one pc that is running apache webservice and have the port 8080 open soh i can record its IP in my device just that nothing more, whats the simplest mode i can do that?

    Wednesday, September 25, 2013 4:59 PM
  • User565 posted

    By iterating through every adress and calling the webservice.

    If you get a timeout.......

    Thursday, September 26, 2013 8:21 AM