Exemple #1
0
class TimeoutHTTP(HTTPConnection):
    """A custom http connection object that supports socket timeout."""
    def __init__(self, host, port=None, timeout=20):
        HTTPConnection.__init__(self, host, port)
        self.timeout = timeout

    def connect(self):
        self.sock = TimeoutSocket(self.timeout)
        self.sock.connect((self.host, self.port))
Exemple #2
0
class TimeoutHTTP(HTTPConnection):
    """A custom http connection object that supports socket timeout."""
    def __init__(self, host, port=None, timeout=20):
        HTTPConnection.__init__(self, host, port)
        self.timeout = timeout

    def connect(self):
        self.sock = TimeoutSocket(self.timeout)
        self.sock.connect((self.host, self.port))
Exemple #3
0
 def connect(self):
     self.sock = TimeoutSocket(self.timeout)
     self.sock.connect((self.host, self.port))
Exemple #4
0
 def connect(self):
     sock = TimeoutSocket(self.timeout)
     sock.connect((self.host, self.port))
     realsock = getattr(sock.sock, '_sock', sock.sock)
     ssl = socket.ssl(realsock, self.key_file, self.cert_file)
     self.sock = httplib.FakeSocket(sock, ssl)
Exemple #5
0
 def connect(self):
     sock = TimeoutSocket(self.timeout)
     sock.connect((self.host, self.port))
     realsock = getattr(sock.sock, '_sock', sock.sock)
     ssl = socket.ssl(realsock, self.key_file, self.cert_file)
     self.sock = httplib.FakeSocket(sock, ssl)
Exemple #6
0
 def connect(self):
     self.sock = TimeoutSocket(self.timeout)
     self.sock.connect((self.host, self.port))