def sendPing(self, serial, cbFun, cbCtx): msgId = next.getId() self.send(protocol.preparePingData(msgId, serial, self.__secret)) self.__pendingReqs[msgId] = cbFun, cbCtx
def sendReq(self, req, cbFun, cbCtx): msgId = next.getId() self.send(protocol.prepareRequestData(msgId, req, self.__secret)) self.__pendingReqs[msgId] = cbFun, cbCtx return msgId