What is a good way to track connected users to my WCF server. EX: I have user accounts that each have usage sessions. If a user has 100 sessions registered on his account, he can connect 100 times from the same username. Keeping track of connections is straight-forward. But what about how to keep track if a user disconnects? How can the server be notified that the TCP connection on the end user got terminated?
I am creating a handler for when the channel gets closed. But how can I now match something in the sender / EventArgs to meaningful connection data.
OperationContext.Current.Channel.Closed += _Closed;
private void _Closed(object sender, EventArgs e)
{
}