MCPcopy Index your code
hub / github.com/python/cpython / makeSocket

Method makeSocket

Lib/logging/handlers.py:585–600  ·  view source on GitHub ↗

A factory method which allows subclasses to define the precise type of socket they want.

(self, timeout=1)

Source from the content-addressed store, hash-verified

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 """

Callers 1

createSocketMethod · 0.95

Calls 5

socketMethod · 0.80
create_connectionMethod · 0.45
settimeoutMethod · 0.45
connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected