Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Send request out over a network and wait for a response, from anything?

I'm potentially looking to send out a packet, or some kind of request across a network but not to anything specific. A machine or possible multiple would have a piece of software installed listening for a this specific packet or request and respond. The mainframe server would then know it has x amount of servers to share out work too.

Can i use some form of UDP broadcasting or TCP Packets to achieve this kind of thing? I would be using C# .NET to do this.

The end result of this issue would be to have a main server that has tasks to accomplish but likes to share the work out across a number of machine if any of available, but it would never know anything about them. It would send out the request saying "i need some work done" a machine would respond with like "Im free" + the IP Address then the main machine would be able to use TCP connection to deliver work (i can easily achieve this part). I just need to make the initial blind request across a network.

I hope that makes sense, if i have to figure out another way so the main machine knows about all its workers then i will but i would prefer not too.

Thanks

Steve

like image 786
Steven Yates Avatar asked Jan 31 '26 07:01

Steven Yates


1 Answers

Sounds like you want to do multicasting, which is well accomplished with UDP instead of TCP.

I found an article describing how you'd do such a thing.

http://www.codeproject.com/Articles/1705/IP-Multicasting-in-C

like image 124
djdanlib Avatar answered Feb 01 '26 21:02

djdanlib