Returns a connection to the address of a `Listener`
(address, family=None, authkey=None)
| 538 | |
| 539 | |
| 540 | def Client(address, family=None, authkey=None): |
| 541 | ''' |
| 542 | Returns a connection to the address of a `Listener` |
| 543 | ''' |
| 544 | family = family or address_type(address) |
| 545 | _validate_family(family) |
| 546 | if family == 'AF_PIPE': |
| 547 | c = PipeClient(address) |
| 548 | else: |
| 549 | c = SocketClient(address) |
| 550 | |
| 551 | if authkey is not None and not isinstance(authkey, bytes): |
| 552 | raise TypeError('authkey should be a byte string') |
| 553 | |
| 554 | if authkey is not None: |
| 555 | answer_challenge(c, authkey) |
| 556 | deliver_challenge(c, authkey) |
| 557 | |
| 558 | return c |
| 559 | |
| 560 | |
| 561 | if sys.platform != 'win32': |
no test coverage detected
searching dependent graphs…