public void Remove(LazynetSession session) { if (this.SessionGroup.ContainsKey(session.ID)) { this.SessionGroup.Remove(session.ID); } }
public void RemoveSession(LazynetSession session) { if (this.SessionGroup is null) { throw new Exception("session group未初始化"); } this.SessionGroup.Remove(session); }
public void AddSession(LazynetChannelHandlerContext channelHandlerContext) { var session = new LazynetSession() { Context = channelHandlerContext, ID = SnowflakeUtil.Instance().GetString() }; this.SessionGroup.Add(session); }