Solved

discovery of client apps on a network

Posted on 2004-09-30
3
244 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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…

839 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