VSCode: Use port 39999 to test for debugger readiness.

This commit is contained in:
Jacob Oursland
2024-05-08 17:57:21 -06:00
committed by Chris Hennes
parent bd7abe5521
commit 11ae698033
2 changed files with 5 additions and 5 deletions

View File

@@ -11,8 +11,8 @@ debugpy.listen(('localhost', 5678))
# Turns out you cannot probe debugpy to see if it is up:
# https://github.com/microsoft/debugpy/issues/974
# Open another port that the script WaitForDebugpy can probe to see if
# Open another port that the script WaitForDebugpy can probe to see if
# debugpy is running
listener = Listener(('localhost', 6000), backlog=10)
listener = Listener(('localhost', 39999), backlog=10)
debugpy.wait_for_client()

View File

@@ -1,7 +1,7 @@
import socket
from contextlib import closing
import time
TIMEOUT_TIME_S = 30
RETRY_DELAY_S = 0.1
@@ -16,7 +16,7 @@ def main():
# DO NOT CHECK 5678 or debugpy will break
# Check other port manually opened instead
attempt_counter = 0
while (not check_socket('localhost', 6000)) and attempt_counter < MAX_ATTEMPTS:
while (not check_socket('localhost', 39999)) and attempt_counter < MAX_ATTEMPTS:
time.sleep(RETRY_DELAY_S)
attempt_counter += 1
@@ -26,4 +26,4 @@ def main():
exit(0)
if __name__ == "__main__":
main()
main()