Sockets - Send message from server to multiple clients

Buddy08

New member
Joined
Feb 25, 2010
Messages
1
Location
D.C.
Programming Experience
1-3
Hey all,

Ok, so I'm actually a system/network administrator, but in my current duty position I've had a lot of freedom to do some development. I've been essentially "playing" for the last couple of years, had a couple programming classes in college, etc., but I still consider myself a beginner.

A few years ago, I made a broadcast program in VB6. It queried Active Directory for a list of clients on the network and then sent a ping packet to each client to see if it was up. If it was up, the host name was added to a list. The broadcast message was sent via the messenger service in Windows (net send).

I'm re-creating this program with Visual Studio 2008 and I'd really like to get away from using the messenger service. I've done a good amount of research and reading on Sockets and Remoting, but I'm having trouble with the whole multiple clients thing.

What is the main difference between Remoting and Sockets? Which would be easier to use to send a message to multiple clients on a domain? Am I going to need to have the server program running constantly? Is there a way to monitor connections (i.e. if a client is up and running, it's name can go straight into an active hosts list rather than querying AD and pinging and all that)?

What I'd really like to do is make the client portion a service. In my head, this is what I'm looking for... A users isn't logged on to a specific workstation. We send a message out and x amount of time later the user logs in. The client message window pops up with the message we sent out x minutes ago. Kind of like a message queue in case no one is logged on to a particular system. Is something like this possible?

Am I just in way over my head and should I just use the messenger service?

Thanks in advance!

Buddy
 

picoflop

Well-known member
Joined
Feb 25, 2009
Messages
158
Programming Experience
5-10
If you need something like message storing, I'd work with a global database where the messages are stored and maybe some kind of information system based on UDP packets.

When you want to send a message to a certain "user", you store the message in the DB and send a braodcast packet with something like "New Message For:John". If John is logged in (and has his client software running) he (the tool of course) gets the info that a new message is in the DB and so he can query it. If he is not logged in, the msg is in the DB and after he logs in and starts his tool, the tool checks the DB if any unread messages are in.
Since network load would not be very high (guess!), you could simply fire out UDP broadcast packages, so you don't have to care about pinging etc.

If you want to know if a certain user is online, you could send some kind of broadcast package that acts as a Ping:
You: "Ping:John"
John: "Pong:John"
or:
You: "Ping:All"
John: "Pong:John"
Mary: "Pong:Mary"
 
Top Bottom