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