What is a good way to track connected users on my WCF server. EX: I have user accounts, each of which has use sessions. If a user has 100 sessions registered in his account, he can connect 100 times from the same username. Connection tracking is straightforward. But what about tracking if the user disconnects? How can a server be notified when a TCP connection to an end user is complete?
I create a handler when the channel closes. But how can I now match something in the sender / EventArgs with meaningful connection data.
OperationContext.Current.Channel.Closed += _Closed; private void _Closed(object sender, EventArgs e) { }
source share