More explicit name for the tcp.Server handler counter

This commit is contained in:
Aldo Cortesi 2016-06-03 13:57:12 +12:00
parent 0d4a930397
commit 6943d7e397
2 changed files with 4 additions and 4 deletions

View File

@ -872,10 +872,10 @@ class TCPServer(object):
self.socket.bind(self.address()) self.socket.bind(self.address())
self.address = Address.wrap(self.socket.getsockname()) self.address = Address.wrap(self.socket.getsockname())
self.socket.listen(self.request_queue_size) self.socket.listen(self.request_queue_size)
self.counter = Counter() self.handler_counter = Counter()
def connection_thread(self, connection, client_address): def connection_thread(self, connection, client_address):
with self.counter: with self.handler_counter:
client_address = Address(client_address) client_address = Address(client_address)
try: try:
self.handle_client_connection(connection, client_address) self.handle_client_connection(connection, client_address)

View File

@ -50,9 +50,9 @@ class Daemon:
if time.time() - start >= timeout: if time.time() - start >= timeout:
raise TimeoutError( raise TimeoutError(
"%s service threads still alive" % "%s service threads still alive" %
self.thread.server.counter.count self.thread.server.handler_counter.count
) )
if self.thread.server.counter.count == 0: if self.thread.server.handler_counter.count == 0:
return return
def expect_log(self, n, timeout=5): def expect_log(self, n, timeout=5):