def send(self):
        assert self.has_data_ready(), "Attempt to send without data ready"
        data = self._dequeue()
        len_data = len(data)

        log.debug("SEND %i bytes to %s" %
                # XXX Ignore warnings, subclasses implement self.peer
                (len_data, self.peer))
        # Send the number of bytes to read in ascii, and then a nul
        # TODO Buffer this out to amke sure that we don't block.
        idx = 0
        while idx < len_data:
            try:
                idx += self.socket.send(data[idx:])
            except socket.error as e:
                if e.errno == errno.EWOULDBLOCK:
                    # Put the remaining bytes back on the stack for the next
                    # run through the event loop
                    self.write_queue.append((data[idx:],))
                    return False
                elif e.errno == errno.EBADF:
                    # Connection has been closed. Nuke it.
                    self.close_and_finalise()
                else:
                    raise
        return True
Retrieve a generator of extensions
dataset/ETHPy150Open richo/groundstation/groundstation/sockets/stream_socket.py/StreamSocket.send--crossover with--dataset/ETHPy150Open openstack/python-openstacksdk/openstack/compute/v2/_proxy.py/Proxy.extensions