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); }
private void AddNewSessionItem(ISessionItem item) { if (item == null) { Console.WriteLine("error:AddNewSessionItem item对象为空!"); } else { item.InitSession(_CurReceiver, _CurSender); _CurSessionItems.Add(item); } }
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); });
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); }); }
private void RemoveNewSessionItem(ISessionItem item) { _CurSessionItems.Remove(item); }
public bool TryGetObject(string name, out ISessionItem <T> obj) { return(_store.TryGetValue(name, out obj)); }
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); }