def __init__(self, host, port, backend_mod=None, pool=None,
            is_ssl=False, extra_headers=[], proxy_pieces=None, timeout=None,
            **ssl_args):

        # connect the socket, if we are using an SSL connection, we wrap
        # the socket.
        self._s = backend_mod.Socket(socket.AF_INET, socket.SOCK_STREAM)
        if timeout is not None:
            self._s.settimeout(timeout)
        self._s.connect((host, port))
        if proxy_pieces:
            self._s.sendall(proxy_pieces)
            response = cStringIO.StringIO()
            while response.getvalue()[-4:] != '\r\n\r\n':
                response.write(self._s.recv(1))
            response.close()
        if is_ssl:
            self._s = ssl.wrap_socket(self._s, **ssl_args)

        self.extra_headers = extra_headers
        self.is_ssl = is_ssl
        self.backend_mod = backend_mod
        self.host = host
        self.port = port
        self._connected = True
        self._life =  time.time() - random.randint(0, 10)
        self._pool = pool
        self._released = False
dataset/ETHPy150Open benoitc/restkit/restkit/conn.py/Connection.__init__/original