TCP/UDP hybrid program unicast/broadcast

TyB

Well-known member
Joined
May 14, 2009
Messages
102
Programming Experience
3-5
I wrote a program that basically sends a message to all me client on a certain port using System.Net.Sockets.TcpClient() to listen on one and send on the other.

This program works fine and without fail although I have come to realize one problem.

The problem is that when I want to send to a large number of PCs in our organization it can take 10 minutes + even with a 3 second timeout built in.

The logical solution I'm guessing would be to change this to UDP broadcasting?, But I would like to have a hybrid setup where I could contact groups or all.

So ideally the the clients (in my scenario) would listen to a port. The user would be using the server application to send the message which I would use logic to separate if I want to send the message to all using UPD or to a group of PCs using TCP.

Another addition I would like to possibly add is for the client to tell me if the got the message in broadcast mode. In TCP I already know because the connection fails. So would I have to have a Listener on a different port on my server and a matching sender on the client to send when it receives a message?

Thanks,
Ty
 
Back
Top