(self)
Connect to the host and port specified in __init__.
Connect to the host and port specified in __init__.
Connect to the host and port specified in __init__ .
def connect(self):
        """Connect to the host and port specified in __init__."""
        sys.audit("http.client.connect", self, self.host, self.port)
        self.sock = self._create_connection(
            (self.host,self.port), self.timeout, self.source_address)
        # Might fail in OSs that don't implement TCP_NODELAY
        try:
             self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
        except OSError as e:
            if e.errno != errno.ENOPROTOOPT:
                raise

        if self._tunnel_host:
            self._tunnel()
def connect ( self ) : sys . audit ( "http.client.connect" , self , self . host , self . port ) self . sock = self . _create_connection ( ( self . host , self . port ) , self . timeout , self . source_address ) # Might fail in OSs that don't implement TCP_NODELAY try : self . sock . setsockopt ( socket . IPPROTO_TCP , socket . TCP_NODELAY , 1 ) except OSError as e : if e . errno != errno . ENOPROTOOPT : raise if self . _tunnel_host : self . _tunnel ( )