I am currently developing a WCF publish subscribe service on a winform app. How do I code it in such a way that whenever a client subscribes to my service, I would be able to display a message in my textbox saying, “1 client has connected/disconnected to/from the service”
Share
As marc said, clients don’t maintain connections to WCF services, but you can monitor imaginary connections by having the clients regularly call an "I’m here" method on the service while they are "connected", and when they stop calling it, you consider them to be "disconnected". I’ve found this strategy to work well for a distributed processing application when I wanted to keep track of how many agents were available to do work.