connects to the address and wraps the connection in an SSL context

def connect(self, address):
        'connects to the address and wraps the connection in an SSL context'
        tout = _timeout(self.gettimeout())
        while 1:
            self._wait_event(tout.now, write=True)
            err = self._connect(address, tout.now)
            if err in (errno.EINPROGRESS, errno.EALREADY, errno.EWOULDBLOCK):
                continue
            if err:
                raise socket.error(err, errno.errorcode[err])
            return 0