Source code for fastiot.util.ports
from socket import socket
[docs]def get_local_random_port() -> int:
with socket() as temp_socket:
temp_socket.bind(('', 0))
return temp_socket.getsockname()[1]
from socket import socket
[docs]def get_local_random_port() -> int:
with socket() as temp_socket:
temp_socket.bind(('', 0))
return temp_socket.getsockname()[1]