开发者

WCF vs. WCF Duplex vs. Sockets

开发者 https://www.devze.com 2023-02-16 00:16 出处:网络
I posted about this before to a degree, but after a few days of reading I have a better understanding of WCF and would like to get a bit o开发者_JAVA技巧f feedback before I start working on it.

I posted about this before to a degree, but after a few days of reading I have a better understanding of WCF and would like to get a bit o开发者_JAVA技巧f feedback before I start working on it.

I basically need to develop a server/client system. The "server" application (c# net console app) will be ran on a machine with a MySQL database, all software installation packages, and whatever else we need local to it. The "client" application (c# net console app) will be ran on the rest of our machines, and will maintain a direct connection to the server software. Using a web front-end, our administrators will be able to install software packages to the clients, create new services, etc.

Since we own all of the machines, and have to configure them anyways, Server Push is not a problem. We don't have to worry about firewalls or any sort of NAT settings as we can just go in and open the ports required for it to operate.

What initially confused me about WCF is I assocated a "WCF Service" with a server. However, since the majority of operations are actually going to be run on the "WCF Service", this is my logic.

1) Make the "client" application actually a "WCF Service" so that the exposed functions are actually ran on the proper machines.

2) Have the "server" application actually a "WCF Client", and issue all of the instructions/commands from here, and just use the return value to update the database/etc.

Would this be the proper method to go follow or should I look into WCF Duplex (Looked extremely confusing at first glance) or just start with raw sockets?


from what I gatther you're trying to do, you're correct. That is the client machines should really have a TCP/IP "server" running on them, and the centeral server machine would have the Tcp/IP "Client".

That way the TCP/IP client (The app running on your server machine) can initiate calls to each of the client machines.

Keep in mind also that a single application can be both a tcp/ip client and server. So your app that's running on the server machine could in turn also be a tcp/ip server that your admin uses to do stuff using a browser. Which effectively means that service is an HTTP service.


So, it is not a client/server thing. It is a hub-and-spoke arrangement of distributed computing. I think, WCF can very well be used. You have multiple servers and a coordinator (the client to all of these servers) that gets the work done from various servers and update the database.

So WCF is well-suited for you. The benefit of WCF is the easy configurability and handling the communication part. You don't have to take much pain for the management of sockets.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号