Solved

discovery of client apps on a network

Posted on 2004-09-30
3
243 Views
Last Modified: 2010-04-17
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?
0
Comment
Question by:bshervey
3 Comments
 
LVL 3

Expert Comment

by:KeithWatson
ID: 12193718
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
0
 
LVL 3

Accepted Solution

by:
Validor earned 250 total points
ID: 12194592
Mailslots also allow you to broadcast to all machines.  Each client will need to set up a mailslot to receive a mailslot message.  Mailslots are unidirectional and delivery is not guaranteed.

You can also try a Class C TCP network scan, where you try to connect to all IP addresses in your class C (which is the 172.10.10. part of the server machine's IP address if it is 172.10.10.200 for example).  So if the client is listening on a socket port, the server could attempt 255 connections, from 172.10.10.1 to 172.10.10.255.  Any connection made would indicate a listening client.
0
 
LVL 3

Expert Comment

by:aravindtj
ID: 12201444
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.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question