Exemplo n.º 1
0
 public void AddClient(UnityClient client, int ID)
 {
     using (WriteLock.TryEnter(this.readerWriterLockSlim, 1000))
     {
         Clients.Add(ID, client);
     }
 }
Exemplo n.º 2
0
 public int AddClient(UnityClient client)
 {
     using (WriteLock.TryEnter(this.readerWriterLockSlim, 1000))
     {
         int ID = (AvailableIDs.Count == 0) ? Clients.Count + 1 : AvailableIDs.Pop();
         Clients.Add(ID, client);
         return(ID);
     }
 }