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

            this.SessionGroup.Add(session);
        }