A factory method which allows subclasses to define the precise type of socket they want.
(self, timeout=1)
| 579 | self.retryFactor = 2.0 |
| 580 | |
| 581 | def makeSocket(self, timeout=1): |
| 582 | """ |
| 583 | A factory method which allows subclasses to define the precise |
| 584 | type of socket they want. |
| 585 | """ |
| 586 | if self.port is not None: |
| 587 | result = socket.create_connection(self.address, timeout=timeout) |
| 588 | else: |
| 589 | result = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) |
| 590 | result.settimeout(timeout) |
| 591 | try: |
| 592 | result.connect(self.address) |
| 593 | except OSError: |
| 594 | result.close() # Issue 19182 |
| 595 | raise |
| 596 | return result |
| 597 | |
| 598 | def createSocket(self): |
| 599 | """ |
no test coverage detected