Skip to content

Commit

Permalink
sock.close() on get_random_port
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcoding committed Mar 11, 2017
1 parent bccf818 commit 0ba76de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion asynctnt/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ def _generate_root_folder_name(self):
def get_random_port():
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('', 0))
return sock.getsockname()[1]
port = sock.getsockname()[1]
sock.close()
return port

def _create_initlua_template(self):
return """
Expand Down

0 comments on commit 0ba76de

Please sign in to comment.