コード例 #1
0
 private void RemoveNode(NODE node)
 {
     RWLock_ClientList.EnterWriteLock();
     try
     {
         nodes.Remove(node);
     }
     finally
     {
         RWLock_ClientList.ExitWriteLock();
     }
 }
コード例 #2
0
 /// <summary>
 /// 删除指定的客户端连接
 /// </summary>
 /// <param name="theConnection">指定的客户端连接</param>
 private void RemoveConnection(SocketConnection theConnection)
 {
     RWLock_ClientList.EnterWriteLock();
     try
     {
         _clientList.Remove(theConnection);
         HandleClientClose?.Invoke(theConnection, this);
     }
     finally
     {
         RWLock_ClientList.ExitWriteLock();
     }
 }