Link to home
Start Free TrialLog in
Avatar of bshervey
bshervey

asked on

discovery of client apps on a network

I have a simple Asynchronous Server and Client application.  Is there a way that I can scan the local network and discover which clients are available and which aren't?  Something like a broadcast request?
Avatar of KeithWatson
KeithWatson

IP multicast allows you to broadcast messages to anyone listening to the same multicast group. It requires a multicast-enabled routes; most are these days, at least in an internal network.

There is some example code at this site:

http://www.smotricz.com/kabutz/Issue028.html
ASKER CERTIFIED SOLUTION
Avatar of Validor
Validor

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,
   In your application, Open a MultiCast port on a particular multicast address.
   In that multicast address, just listen for connection.
   Whenever you want discover, just send a packet on the multicast address.
   All the other applications will get the packet and must reply some data back to you.
   So, whenever you are getting a reply, you can get taarget machines IP address.
   Thus, keep a hash table to store recieved host IP address.[duplications will be avoided.]
   You must keep in mind to avoid local loopback. ie, your own multicast packet will be back to you.
    To avoid this, use setsockopt(.....) function.

Hope this may help you.

all the best.