Beispiel #1
0
        private void HandleClientDisconnected(object sender, EventArgs e)
        {
            IClient client = (IClient) sender;
            client.Disconnected -= HandleClientDisconnected;

            clientRepository.DeleteByID(client.ID);

            DisconnectedEvent disconnectedEvent = new DisconnectedEvent(client);
            EventHub.Publish(disconnectedEvent);
        }
        private void OnClientDisconnected(DisconnectedEvent ev)
        {
            IClient client = ev.Client;
            MessageHandler messageHandler = this[client];

            if (messageHandler != null)
            {
                messageHandler.HandleDisconnect(client);
                Remove(client);
            }
        }