added trycatch for ipv4

This commit is contained in:
Concedo 2025-02-26 00:45:06 +08:00
parent 62cd9bb0b2
commit 50eae1ffeb

View file

@ -3116,8 +3116,11 @@ def RunServerMultiThreaded(addr, port, server_handler):
ipv6_sock = context.wrap_socket(ipv6_sock, server_side=True) ipv6_sock = context.wrap_socket(ipv6_sock, server_side=True)
numThreads = 24 numThreads = 24
try:
ipv4_sock.bind((addr, port)) ipv4_sock.bind((addr, port))
ipv4_sock.listen(numThreads) ipv4_sock.listen(numThreads)
except Exception:
print("IPv4 Socket Failed to Bind.")
if ipv6_sock: if ipv6_sock:
try: try: