'Called when we have something to send out on the socket'

def _send_request(self, read_timeout, connect_timeout):

    client = self.client
    try:
        (request, async_object) = client._queue[0]
    except IndexError:
        try:
            os.read(self._read_pipe, 1)
        except OSError:
            pass
        return
    if (request is _SESSION_EXPIRED):
        raise SessionExpiredError('Session    expired:    Testing')
    if (request is _CONNECTION_DROP):
        raise ConnectionDropped('Connection    dropped:    Testing')
    if (request.type == Auth.type):
        xid = AUTH_XID
    else:
        self._xid += 1
        xid = self._xid
    self._submit(request, connect_timeout, xid)
    client._queue.popleft()
    os.read(self._read_pipe, 1)
    client._pending.append((request, async_object, xid))
