'activates the connection object'

def _connect(self):

    if (not self._connected):
        wrong_user = False
        tries = 3
        self.conn = socket.socket()
        self.conn.settimeout(C.ACCELERATE_CONNECT_TIMEOUT)
        display.vvvv(('attempting    connection    to    %s    via    the    accelerated    port    %d' % (self._play_context.remote_addr, self._play_context.accelerate_port)), host=self._play_context.remote_addr)
        while (tries > 0):
            try:
                self.conn.connect((self._play_context.remote_addr, self._play_context.accelerate_port))
                break
            except socket.error:
                display.vvvv(('connection    to    %s    failed,    retrying...' % self._play_context.remote_addr), host=self._play_context.remote_addr)
                time.sleep(0.1)
                tries -= 1
        if (tries == 0):
            display.vvv('Could    not    connect    via    the    accelerated    connection,    exceeded    #    of    tries', host=self._play_context.remote_addr)
            raise AnsibleConnectionFailure(('Failed    to    connect    to    %s    on    the    accelerated    port    %s' % (self._play_context.remote_addr, self._play_context.accelerate_port)))
        elif wrong_user:
            display.vvv('Restarting    daemon    with    a    different    remote_user', host=self._play_context.remote_addr)
            raise AnsibleError('The    accelerated    daemon    was    started    on    the    remote    with    a    different    user')
        self.conn.settimeout(C.ACCELERATE_TIMEOUT)
        if (not self.validate_user()):
            wrong_user = True
    self._connected = True
    return self
