VSCode: Use port 39999 to test for debugger readiness.
This commit is contained in:
committed by
Chris Hennes
parent
cc39030293
commit
dc9f42de1e
@@ -11,8 +11,8 @@ debugpy.listen(('localhost', 5678))
|
|||||||
|
|
||||||
# Turns out you cannot probe debugpy to see if it is up:
|
# Turns out you cannot probe debugpy to see if it is up:
|
||||||
# https://github.com/microsoft/debugpy/issues/974
|
# 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
|
# debugpy is running
|
||||||
listener = Listener(('localhost', 6000), backlog=10)
|
listener = Listener(('localhost', 39999), backlog=10)
|
||||||
|
|
||||||
debugpy.wait_for_client()
|
debugpy.wait_for_client()
|
||||||
|
|||||||
6
contrib/.vscode/scripts/WaitForDebugpy.py
vendored
6
contrib/.vscode/scripts/WaitForDebugpy.py
vendored
@@ -1,7 +1,7 @@
|
|||||||
import socket
|
import socket
|
||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
import time
|
import time
|
||||||
|
|
||||||
TIMEOUT_TIME_S = 30
|
TIMEOUT_TIME_S = 30
|
||||||
RETRY_DELAY_S = 0.1
|
RETRY_DELAY_S = 0.1
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ def main():
|
|||||||
# DO NOT CHECK 5678 or debugpy will break
|
# DO NOT CHECK 5678 or debugpy will break
|
||||||
# Check other port manually opened instead
|
# Check other port manually opened instead
|
||||||
attempt_counter = 0
|
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)
|
time.sleep(RETRY_DELAY_S)
|
||||||
attempt_counter += 1
|
attempt_counter += 1
|
||||||
|
|
||||||
@@ -26,4 +26,4 @@ def main():
|
|||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user