Beispiel #1
0
        public void CloseClientSocket(ISessionItem session)
        {
            Interlocked.Decrement(ref _NumConnectedSockets);
            _MaxNumberAcceptedClients.Release();

            _RemoveCallBack(session);

            Console.WriteLine("A client has been disconnected from the server. There are {0} clients connected to the server", _NumConnectedSockets);
        }
Beispiel #2
0
 private void AddNewSessionItem(ISessionItem item)
 {
     if (item == null)
     {
         Console.WriteLine("error:AddNewSessionItem item对象为空!");
     }
     else
     {
         item.InitSession(_CurReceiver, _CurSender);
         _CurSessionItems.Add(item);
     }
 }
Beispiel #3
0
 public void PutObject(string name, ISessionItem <T> obj) => _store.AddOrUpdate(name.StripVersion(), obj, (n, o) =>
 {
     if (n == name)
     {
         obj.Version = o.Version + 1;
     }
     else
     {
         obj.Version = 1;
     }
     return(obj);
 });
Beispiel #4
0
 public void PutObject(string name, ISessionItem <T> obj)
 {
     _store.AddOrUpdate(name, obj, (n, o) =>
     {
         if (o == obj)
         {
             obj.Version++;
         }
         else
         {
             obj.Version = 1;
         }
         return(obj);
     });
 }
Beispiel #5
0
 private void RemoveNewSessionItem(ISessionItem item)
 {
     _CurSessionItems.Remove(item);
 }
Beispiel #6
0
 public bool TryGetObject(string name, out ISessionItem <T> obj)
 {
     return(_store.TryGetValue(name, out obj));
 }
Beispiel #7
0
 public bool TryGetObject(string name, out ISessionItem <T> obj) => _store.TryGetValue(name.StripVersion(), out obj);
 public void Detatch(ISessionItem item)
 {
     _trackedItems.Remove(item);
 }
 public void Attach(ISessionItem item)
 {
     _trackedItems.Add(item);
 }
 public Talk(ISessionItem session)
 {
     Data = session;
 }
 public Lightning(ISessionItem session)
     : base(session)
 {
     Data = session;
     Data.StartTime = new TimeSpan(0, ConferenceEvent.LIGHTING_DURATION, 0);
 }