Returns pair of connection objects at either end of a pipe
(duplex=True)
| 531 | if sys.platform != 'win32': |
| 532 | |
| 533 | def Pipe(duplex=True): |
| 534 | ''' |
| 535 | Returns pair of connection objects at either end of a pipe |
| 536 | ''' |
| 537 | if duplex: |
| 538 | s1, s2 = socket.socketpair() |
| 539 | s1.setblocking(True) |
| 540 | s2.setblocking(True) |
| 541 | c1 = Connection(s1.detach()) |
| 542 | c2 = Connection(s2.detach()) |
| 543 | else: |
| 544 | fd1, fd2 = os.pipe() |
| 545 | c1 = Connection(fd1, writable=False) |
| 546 | c2 = Connection(fd2, readable=False) |
| 547 | |
| 548 | return c1, c2 |
| 549 | |
| 550 | else: |
| 551 |
no test coverage detected