Hi everyone, I'm making a program that will run in the background on many computers in a LAN and will listen for a signal from one master client program.
My problem is that I don't know how to get the master program to quickly compile a list of all the computers that are online on the subnet, and then open multiple connections to all of the online computers.
Thus, in one sentence form, the two questions are:
1. How can I compile a list, quickly, of all the computers online on the same subnet the computer doing the searching is on
2. How do I open and maintain connections to multiple "servers" at once, so that they are ready and waiting to receive data
Thanks in advance.

Connect to many servers quickly (C#)
ShashankG
It's not actually too difficult. Read up on System.Net.Sockets.UdpClient, and in particular JoinMulticastGroup. Everything else is pure Sockets programming.
Alex Dresko (MVP wannabe)
1. How can I compile a list, quickly, of all the computers online on the same subnet the computer doing the searching is on
How to get All computers running on LAN right now http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1090093&SiteID=1
2. How do I open and maintain connections to multiple "servers" at once, so that they are ready and waiting to receive data
As some other has already suggested you can use IP Multicasting on UDP to send the same message to all those listed computers.
Or if the data to be sent to different computers differ then:
You can create multiple TCP Sockets to connect to each and then each socket will do transfer data to those computer.
(Multiple Sockets because a Socket can accept multiple connecitons at the same time but cannot connect to other Multiple sockets using a single instance)
I hope this will help.
Best Regards,
Rizwan aka RizwanSharp
swiego
Gabyx
Yes, I try to keep UDP mesages as small as possible. If they're smaller than the packet size, then you don't have to worry about ordering as much. It shouldn't really be used for communications so much as a heads-up, giving enough information for interested parties to connect using TCP.
learnerplates
In reference to the first reply, about 20 clients. The data is all identical, so there should be no problem with IP Multicasting, I just have to figure out how to do that. Heh.
April m
krunal k
This is good news, because that's exactly what I'll be doing, the computers merely need to receive a single command that is their cue to begin executing a certain block of code, so it sounds like UDP is going to work out just fine.