4

I am starting on a fairly basic Server/Client application (logic wise), but I am a bit confused as to what I should use for my needs. It looks like there a few options, but basically I am going to have a Master Server, and X amount of client applications (one per dedicated machine). The main purpose of this setup is so that I can basically do the following...

-Issue command to server (console app) via an ASP front end to install software on one of the remote clients. - Server tells client to download zip package (from a various FTP site) to location and extract it to specific path.

I am not positive, but it looks like C# has Sockets and then some sort of WebClient type of deal. I am assuming Sockets would be the best route to take, and to use asynchronous (each remote client is connected in its own thread, dealing with the server individually of others).

Any information on this would be great!

1
  • 1
    Sockets are almost certainly too low-level for your scenario. WCF sounds like a good option for this.
    – driis
    Commented Mar 6, 2011 at 13:50

2 Answers 2

8

Without going into too much detail for your specific requirements, I would definitely look at WCF.

It encompasses a lot of the existing remoting, client / server, web services scenarios in a very complete and secure framework.

Client Server Programming with WCF

4
  • Interesting, I had not come across that when reading up on Server/Client in C# NET. Basically I am creating a deployment/management panel. We have about 40 machines all over the world, and one central machine to host the master server. The remote machines will need to handle pulling install packages, installing them, making them windows services, etc. WCF looks like it might work perfect for this.
    – user470760
    Commented Mar 6, 2011 at 13:55
  • As Jon said, only for later than .net 2.0 but I had used lots of the technologies WCF encompasses separately before and now use WCF in the bulk of my .net development now.
    – PMC
    Commented Mar 6, 2011 at 13:59
  • Think I will go ahead and suck it up and start learning WCF. It does look completely confusing, but should be worth it. Just from reading a list of pros it has over .NET remoting, it sounds like it is exactly what I need.
    – user470760
    Commented Mar 6, 2011 at 14:17
  • Read about the ABC of WCF, keep it simple with basic bindings and then choose the correct level of binding for your security needs and use Visual Studios WCF config editor and WCFTestClient to get things up and running.
    – PMC
    Commented Mar 6, 2011 at 14:20
2

WebClient allows you to make HTTP requests, so I don't think it's very relevant here.

There are many approaches you can take for this app.

One is of course going with WCF, which provides about a million time more options than you will need. However, WCF does have a learning curve and in particular it's hard to understand what exactly is hidden behind all the abstractions without prior experience. Furthermore, this solution is not available if you are targeting .NET 2.0.

You can also implement a simple TCP client/server model using sockets. While you can program against raw sockets, .NET also offers the convenience classes System.Net.Sockets.TcpListener for the server and System.Net.Sockets.TcpClient for the clients. This approach is much closer to the metal, but this is a tradeoff: it's much easier to understand what exactly you are doing, but you will have to implement a fair bit of functionality yourself.

1
  • I appreciate it, I wasn't really positive on the seperation between WebClient, raw sockets, the convenience classes, etc.
    – user470760
    Commented Mar 6, 2011 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.