Does WCF Keep-Alive support more resources than polling?

Maybe I could create a couple of test apps and find out, but I hope someone has tried this already or just simply has a more intuitive understanding. I have three executables. Two different clients (call them Client1.exe and Client2.exe) and a WCF service host (call it Host.exe) that hosts more or less a message bus type service for two clients. I won't go into the "why" as it is a long story and ineffective in this matter.

The point is that Client1 sends a request through this Client2 service. Client2 performs operations and then responds to the results of Client1. Client1 will always be the initiator of requests, so this order of operations will always be consistent that way. This also means that Client1 can open channels for it to communicate with this service as needed, whereas because of the need for callback services, Client2 must keep the channels open. I started by trying to save life. However, it is all three desktop and PC events or other issues (not sure) seem to be getting in the way. And once that expires, everything has to be restarted, which makes it a real pain. I have some ideas that I can try to help keep the approach alive, but this gave rise to a question that I have no answer for ...this is the best use of my resources.

As I understand it, there are two main approaches for Client2:

  • Keep-Alive with a lot of monitoring (timers and checking connection states) and a connection reset code that will be faster as it can respond to requests immediately. The downside is that this needs to be maintained all the time the user keeps Client2 open on their desktop, which can be short and sweet to insane.
  • Polling periodically for a request that will only allow resources to be used when validating or processing a request from Client1. This will be slower as the polling requests will not be in real time, but will fix any external service outage issues. It would also force me to add more states to the service. This is already a PerSession with a list of available instances of the Client2 id so Client1 knows which instance it is talking to, but it will add more.

Client2 performs many other functions and therefore needs to be very efficient with this process, which makes me wonder what is most likely going to cost in resources? Is the polling method more expensive in resources? Or trying to save your life?

+3


source to share





All Articles