def callback(self, iocb):
    'Callback when an iocb is completed by a local controller and the\n        result needs to be sent back to the client.'
    if _debug:
        IOServer._debug('callback %r', iocb)
    if (not self.remoteIOCB.has_key(iocb)):
        IOServer._warning('IOCB not owned by server: %r', iocb)
        return
    (clientID, clientAddr) = self.remoteIOCB[iocb]
    del self.remoteIOCB[iocb]
    if (iocb.ioState == COMPLETED):
        response = (1, clientID, iocb.ioResponse)
    elif (iocb.ioState == ABORTED):
        response = (2, clientID, iocb.ioError)
    else:
        raise RuntimeError('IOCB invalid state')
    if _debug:
        _commlog.debug(('<<< %s: S %s %r' % (_strftime(), clientAddr, response)))
    response = cPickle.dumps(response, 1)
    self.request(PDU(response, destination=clientAddr))
Callback when an iocb is completed by a local controller and the
result needs to be sent back to the client.
def callback(self, iocb):
    'Callback when an iocb is completed by a local controller and the\n        result needs to be sent back to the client.'
    if _debug:
        IOServer._debug('callback %r', iocb)
    if (not self.remoteIOCB.has_key(iocb)):
        IOServer._warning('IOCB not owned by server: %r', iocb)
        return
    (clientID, clientAddr) = self.remoteIOCB[iocb]
    del self.remoteIOCB[iocb]
    if (iocb.ioState == COMPLETED):
        response = (1, clientID, iocb.ioResponse)
    elif (iocb.ioState == ABORTED):
        response = (2, clientID, iocb.ioError)
    else:
        raise RuntimeError('IOCB invalid state')
    if _debug:
        _commlog.debug(('<<< %s: S %s %r' % (_strftime(), clientAddr, response)))
    response = cPickle.dumps(response, 1)
    self.request(PDU(response, destination=clientAddr))