You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would fix a lot of issues, particularly around peers being dropped when they lose connection. We currently have no way to know if a new node was started on the same port or if the old node is still running. This would also fix #14 and #15
This kind of thing:
async def find_free_port(start_port=49152, end_port=65535, max_attempts=100):
"""Find a free port in the ephemeral port range."""
for _ in range(max_attempts):
port = random.randint(start_port, end_port)
try:
with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as sock:
sock.bind(('', port))
return port
except OSError:
continue
raise RuntimeError(f"Unable to find a free port after {max_attempts} attempts")
The text was updated successfully, but these errors were encountered:
This would fix a lot of issues, particularly around peers being dropped when they lose connection. We currently have no way to know if a new node was started on the same port or if the old node is still running. This would also fix #14 and #15
This kind of thing:
The text was updated successfully, but these errors were encountered: