C # NET Server / Client Application

I start with a fairly simple Server / Client application (logical-wise), but I'm a bit confused about what I have to use for my needs. It seems that there are several options, but basically I will have a master server and X the number of client applications (one for a dedicated computer). The main purpose of this setup is that I can basically do the following ...

-Use the command on the server (console application) through the external ASP interface to install the software on one of the remote clients. - The server tells the client to download the zip package (from another FTP site) to the location and retrieve it along a specific path.

I'm not sure, but it looks like C # has Sockets, and then some kind of WebClient transaction. I assume that Sockets will be the best route to use and use asynchronous (each remote client connects in its own thread, dealing with the server separately from the others).

Any info on this would be great!

+4
source share
2 answers

Without going into details for specific requirements, I will definitely look at WCF .

It covers many existing remote access scenarios, client / server, web services in a very complete and secure environment.

Client Server Programming with WCF

+8
source

WebClient allows you to make HTTP requests, so I don't think this is very important here.

There are many approaches you can take for this application.

One of them, of course, comes with WCF, which provides about a million times more options than you need. However, WCF has a learning curve and, in particular, it is difficult to understand what exactly lies behind all abstractions without prior experience. Also, 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 metal, but it is a compromise: it is much easier to understand what exactly you are doing, but you will have to implement honest functionality yourself.

+2
source

Source: https://habr.com/ru/post/1342508/


All Articles