Forum Xamarin.Android

How to make a broadcast to all devices connected to a network?

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?


  • CortezCortez USMember ✭✭✭

    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( -
    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.

  • HiltonMenezesHiltonMenezes BRMember ✭✭

    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?

  • FZelleFZelle DEMember ✭✭✭

    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.

  • HiltonMenezesHiltonMenezes BRMember ✭✭

    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?

  • FZelleFZelle DEMember ✭✭✭

    By iterating through every adress and calling the webservice.

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

Sign In or Register to comment.