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

            this.SessionGroup.Add(session);
        }