Returns pair of connection objects at either end of a pipe
(duplex=True)
| 561 | if sys.platform != 'win32': |
| 562 | |
| 563 | def Pipe(duplex=True): |
| 564 | ''' |
| 565 | Returns pair of connection objects at either end of a pipe |
| 566 | ''' |
| 567 | if duplex: |
| 568 | s1, s2 = socket.socketpair() |
| 569 | s1.setblocking(True) |
| 570 | s2.setblocking(True) |
| 571 | c1 = Connection(s1.detach()) |
| 572 | c2 = Connection(s2.detach()) |
| 573 | else: |
| 574 | fd1, fd2 = os.pipe() |
| 575 | c1 = Connection(fd1, writable=False) |
| 576 | c2 = Connection(fd2, readable=False) |
| 577 | |
| 578 | return c1, c2 |
| 579 | |
| 580 | else: |
| 581 |
no test coverage detected
searching dependent graphs…