1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-05-08 17:08:36 +01:00

Fix timeout on check port (#1116)

This commit is contained in:
Pascal Vizeli
2019-06-05 17:49:05 +02:00
committed by GitHub
parent 89dc78bc05
commit 3e645b6175
+1
View File
@@ -60,6 +60,7 @@ class AsyncThrottle:
def check_port(address: IPv4Address, port: int) -> bool:
"""Check if port is mapped."""
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(0.5)
try:
result = sock.connect_ex((str(address), port))
sock.close()