(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0)
| 26 | socketpair = socket.socketpair |
| 27 | else: |
| 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 | |
| 47 | def find_ready_matching(ready, flag): |
no test coverage detected
searching dependent graphs…