MCPcopy Index your code
hub / github.com/python/cpython / socketpair

Function socketpair

Lib/test/test_selectors.py:28–44  ·  view source on GitHub ↗
(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0)

Source from the content-addressed store, hash-verified

26 socketpair = socket.socketpair
27else:
28 def socketpair(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0):
29 with socket.socket(family, type, proto) as l:
30 l.bind((socket_helper.HOST, 0))
31 l.listen()
32 c = socket.socket(family, type, proto)
33 try:
34 c.connect(l.getsockname())
35 caddr = c.getsockname()
36 while True:
37 a, addr = l.accept()
38 # check that we've got the correct client
39 if addr == caddr:
40 return c, a
41 a.close()
42 except OSError:
43 c.close()
44 raise
45
46
47def find_ready_matching(ready, flag):

Callers 1

make_socketpairMethod · 0.70

Calls 7

socketMethod · 0.80
bindMethod · 0.45
listenMethod · 0.45
connectMethod · 0.45
getsocknameMethod · 0.45
acceptMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…