ChatterBox.Server.RegisteredClient.OnTcpClientDisconnected C# (CSharp) Method

OnTcpClientDisconnected() private method

private OnTcpClientDisconnected ( System.Guid oldConnectionID ) : void
oldConnectionID System.Guid
return void
        private void OnTcpClientDisconnected(Guid oldConnectionID)
        {
            if (oldConnectionID == ConnectionId)
            {
                var itemsToSend = MessageQueue.ToList();

                ActiveConnection = null;
                if (!IsOnline) return;
                IsOnline = false;
                OnDisconnected?.Invoke(this);

                if (_pushNotificationSender != null)
                {
                    foreach (var item in itemsToSend)
                    {
                        _pushNotificationSender.SendNotification(item.SerializedMessage);
                    }
                }
            }
        }