Waits until a connection is available on the wire, or until
        the connection is in a state that it can't accept messages.
        It returns True if a message is available, False otherwise.

def wait_message(self):
        """
        Waits until a connection is available on the wire, or until
        the connection is in a state that it can't accept messages.
        It returns True if a message is available, False otherwise.
        """
        if self._state != states['open']:
            return False
        if len(self._read_queue) > 0:
            return True

        assert self._read_waiter is None or self._read_waiter.cancelled(), \
            "You may only use one wait_message() per connection."

        self._read_waiter = asyncio.Future(loop=self._loop)
        yield from self._read_waiter
        return self.wait_message()