Skip to content

Commit

Permalink
SQ -> IP*: server: If default port in use, search for another port au…
Browse files Browse the repository at this point in the history
…tomatically
  • Loading branch information
davidfstr committed Dec 17, 2023
1 parent ff0b9de commit 8c88ce2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/crystal/util/ports.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
def is_port_in_use_error(e: Exception) -> bool:
if isinstance(e, OSError) and e.errno == 48:
# macOS: [Errno 48] Address already in use
return True
if isinstance(e, OSError) and e.errno == 98:
# Linux: [Errno 98] Address already in use
# macOS: [Errno 48] Address already in use
# Linux: [Errno 98] Address already in use
if isinstance(e, OSError) and str(e) == 'Address already in use':
return True
return False

0 comments on commit 8c88ce2

Please sign in to comment.