Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communication between server and client for WinForms

I have 50+ kiosk style computers that I want to be able to get a status update, from a single computer, on demand as opposed to an interval. These computers are on a LAN in respect to the computer requesting the status.

I researched WCF however it looks like I'll need IIS installed and I would rather not install IIS on 50+ Windows XP boxes -- so I think that eliminates using a webservice unless it's possible to have a WinForm host a webservice?

I also researched using System.Net.Sockets and even got a barely functional prototype going however I feel I'm not skilled enough to make it a solid and reliable system. Given this path, I would need to learn more about socket programming and threading.

These boxes are running .NET 3.5 SP1, so I have complete flexibility in the .NET version however I'd like to stick to C#.

What is the best way to implement this? Should I just bite the bullet and learn Sockets more or does .NET have a better way of handling this?

edit: I was going to go with a two way communication until I realized that all I needed was a one way communication.

edit 2: I was avoiding the traditional server/client and going with an inverse because I wanted to avoid consuming too much bandwidth and wasn't sure what kind of overhead I was talking about. I was also hoping to have more control of the individual kiosks. After looking at it, I think I can still have that with WCF and connect by IP (which I wasn't aware I could connect by IP, I was thinking I would have to add 50 webservices or something).

like image 217
Kenny Mann Avatar asked Jun 26 '26 17:06

Kenny Mann


1 Answers

WCF does not have to be hosted within IIS, it can be hosted within your Winform, as a console application or as windows service. You can have each computer host its service within the winform, and write a program in your own computer to call each computer's service to get the status information.

Another way of doing it is to host one service in your own computer, and make the 50+ computers to call the service once their status were updated, you can use a database for the service to persist the status data of each node within the network. This option is easier to maintain and scalable.

P.S. WCF aims to replace .net remoting, the alternatives can be net.tcp binding or net.pipe

like image 157
Ray Lu Avatar answered Jun 28 '26 06:06

Ray Lu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!