MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / start_server

Function start_server

_pydevd_bundle/pydevd_comm.py:468–487  ·  view source on GitHub ↗

binds to a port, waits for the debugger to connect

(port)

Source from the content-addressed store, hash-verified

466
467
468def start_server(port):
469 """binds to a port, waits for the debugger to connect"""
470 s = create_server_socket(host="", port=port)
471
472 try:
473 s.listen(1)
474 # Let the user know it's halted waiting for the connection.
475 host, port = s.getsockname()
476 msg = f"pydevd: waiting for connection at: {host}:{port}"
477 print(msg, file=sys.stderr)
478 pydev_log.info(msg)
479
480 new_socket, _addr = s.accept()
481 pydev_log.info("Connection accepted")
482 # closing server socket is not necessary but we don't need it
483 s.close()
484 return new_socket
485 except:
486 pydev_log.exception("Could not bind to port: %s\n", port)
487 raise
488
489
490def start_client(host, port):

Callers 1

connectMethod · 0.90

Calls 4

create_server_socketFunction · 0.85
infoMethod · 0.80
exceptionMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected