Beispiel #1
0
    def _receiveOne(self, multiple = 0):
        self._pipeIn = open(self._name_pipe_in,'r')
        # so, let's read the command from the client then - rendevous
        data = ' '
        alldata = ''
        while data != '':
            data = self._pipeIn.read().rstrip()
            alldata += data
        self._pipeIn.close()
##        return alldata
        if multiple:
            extracted = getConnectedServicesWrapper().parseMessages(alldata)
        else:
            extracted = getConnectedServicesWrapper().parseMessage(alldata)
        return extracted
Beispiel #2
0
    def _sendOne(self, message):
        self._globalLock.acquire()
        self._pipeOut = open(self._name_pipe_out,'w')
##        self._pipeIn.write(message)
        wrapped = getConnectedServicesWrapper().assembleMessage(message)
        self._pipeOut.write(wrapped)
        self._pipeOut.flush()
        self._pipeOut.close()
        self._globalLock.release()