mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-18 22:56:31 +00:00
Fix timeout on check port (#1116)
This commit is contained in:
parent
89dc78bc05
commit
3e645b6175
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user