MCPcopy Create free account
hub / github.com/microsoft/debugpy / connect

Function connect

src/debugpy/launcher/__init__.py:16–33  ·  view source on GitHub ↗
(host, port)

Source from the content-addressed store, hash-verified

14
15
16def connect(host, port):
17 from debugpy.common import log, messaging, sockets
18 from debugpy.launcher import handlers
19
20 global channel, adapter_host
21 assert channel is None
22 assert adapter_host is None
23
24 log.info("Connecting to adapter at {0}:{1}", host, port)
25
26 ipv6 = host.count(":") > 1
27 sock = sockets.create_client(ipv6)
28 sock.connect((host, port))
29 adapter_host = host
30
31 stream = messaging.JsonIOStream.from_socket(sock, "Adapter")
32 channel = messaging.JsonMessageChannel(stream, handlers=handlers)
33 channel.start()

Callers

nothing calls this directly

Calls 5

startMethod · 0.95
infoMethod · 0.80
from_socketMethod · 0.80
countMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…