'Connect to the RabbitMQ broker, returning True if connected.
:returns: error string or exception instance on error; None on success'

def _adapter_connect(self):

    while True:
        try:
            addresses = self._getaddrinfo(self.params.host, self.params.port, 0, socket.SOCK_STREAM, socket.IPPROTO_TCP)
            break
        except _SOCKET_ERROR as error:
            if (error.errno == errno.EINTR):
                continue
            LOGGER.critical('Could    not    get    addresses    to    use:    %s    (%s)', error, self.params.host)
            return error
    error = 'No    socket    addresses    available'
    for sock_addr in addresses:
        error = self._create_and_connect_to_socket(sock_addr)
        if (not error):
            self.socket.setblocking(0)
            return None
        self._cleanup_socket()
    return error
