public override void ChannelInactive(IChannelHandlerContext context) { var session = context.Channel.GetAttribute(ChannelAttributes.Session).Get(); _logger.Debug("Client({HostId} - {EndPoint}) disconnected", session.HostId, context.Channel.RemoteAddress.ToString()); session.Dispose(); _sessionManager.RemoveSession(session.HostId); _hostIdFactory.Free(session.HostId); base.ChannelInactive(context); }
public void Remove(uint groupHostId) { if (_groups.TryRemove(groupHostId, out var group)) { foreach (var member in group) { group.Leave(member.HostId); } _hostIdFactory.Free(groupHostId); } _logger.Debug("Removed P2PGroup({HostId})", group.HostId); }