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

            this.SessionGroup.Add(session);
        }