'Send out a message with the given queries.
@type queries: L{list} of C{Query} instances
@param queries: The queries to transmit
@type timeout: L{int} or C{float}
@param timeout: How long to wait before giving up
@type id: L{int}
@param id: Unique key for this request
@type writeMessage: C{callable}
@param writeMessage: One-parameter callback which writes the message
@rtype: C{Deferred}
@return: a C{Deferred} which will be fired with the result of the
query, or errbacked with any errors that could happen (exceptions
during writing of the query, timeout errors, ...).'

def _query(self, queries, timeout, id, writeMessage):

    m = Message(id, recDes=1)
    m.queries = queries
    try:
        writeMessage(m)
    except:
        return defer.fail()
    resultDeferred = defer.Deferred()
    cancelCall = self.callLater(timeout, self._clearFailed, resultDeferred, id)
    self.liveMessages[id] = (resultDeferred, cancelCall)
    return resultDeferred
