Advertisement

scanning a network for servers with unix sockets

Started by June 02, 2006 04:32 PM
3 comments, last by hplus0603 18 years, 8 months ago
I have written a number of simple client/server applications with unix sockets, but I've never had a need to scan a network before. Presume there are a number of machines on a local network that offer certain services. How do I scan each address on the subnet to see if this kind of service is offered on it? Thanks!
nmap -P0 -p <port to scan> 192.168.1.*
Advertisement
I realize now I didn't make my problem very clear. This is not to be done once, but automated from a c program. I suppose I am looking for the sort of behavior you would get when searching for a game server on a LAN.

Cheers!
just write a perl script to iterate the IP range with the above post's command.

otherwise use sockets or something to do the same from a C/C++ app or what have you.

-me
The Forum FAQ talks about this.

In general, you implement local LAN service finding using some kind of broadcast. Using a pre-canned library like MDNS is probably easiest.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement