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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
There is some example code at this site:
http://www.smotricz.com/kabutz/Issue028.html