private void ConnectionAccepted(ConnectClient client) { if (ActiveClientCount > MaxActiveClientCount) { client.Dispose(); return; } Interlocked.Increment(ref _ActiveClientCount); ActiveClientCount++; var thread = new Thread(() => DoClient(client)); thread.IsBackground = true; thread.Start(); }
public void Dispose() { Client.Dispose(); }
public void Dispose() { IsActive = false; Client.Dispose(); }