Commit 126c8b4a authored by Antoine Pitrou's avatar Antoine Pitrou

Avoid ResourceWarnings in ccbench

parent 6a002c02
......@@ -276,7 +276,7 @@ def _recv(sock, n):
return sock.recv(n).decode('ascii')
def latency_client(addr, nb_pings, interval):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock:
_time = time.time
_sleep = time.sleep
def _ping():
......@@ -363,6 +363,7 @@ def run_latency_test(func, args, nthreads):
for t in threads:
t.join()
process.wait()
sock.close()
for recv_time, chunk in chunks:
# NOTE: it is assumed that a line sent by a client wasn't received
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment