def dataReceived(self, data): self.packetStorage.update(data) for rcvMsg in IterateMessages(self.packetStorage, logger, errReporter): print "Rip Client Protocol: dataReceived -- rip message received, current state: ", self.SM.currentState( ) dataToUpper = rcvMsg.Data self.SM.signal(self.SIGNAL_CLIENT_RIPMESSAGE, dataToUpper) print "Rip Client Protocol: dataReceived -- after signal_ripmessage, current state: ", self.SM.currentState( )
def dataReceived(self, data): self.__packetStorage.update(data) for msg in IterateMessages(self.__packetStorage, logger, errReporter): try: self.__fsm.signal(msg.__class__, msg) except StateMachineError, e: errReporter.error( ("State machine error after receiving %s. Error:\n%s") % (msg, e)) self.transport.loseConnection()
def dataReceived(self, data): self.packetStorage.update(data) for rcvMsg in IterateMessages(self.packetStorage, logger, errReporter): if (rcvMsg.SNN == True): print "Rip Protocol: dataReceived -- snn received, current state: ", self.SM.currentState( ) self.SM.signal(self.SIGNAL_SERVER_RCVD_SNN, rcvMsg) print "Rip Protocol: dataReceived -- after;l signal_rcvd_snn, current state: ", self.SM.currentState( ) else: print "Rip Protocol: dataReceived -- rip message received, current state: ", self.SM.currentState( ) dataToUpper = rcvMsg.Data self.SM.signal(self.SIGNAL_SERVER_RIPMESSAGE, dataToUpper) print "Rip Protocol: dataReceived -- after signal_ripmessage, current state: ", self.SM.currentState( )
def dataReceived(self, data): self.packetStorage().update(data) for msg in IterateMessages(self.packetStorage(), logger, errReporter): try: if self.isMain: print("") print(ctime(msg.time)) print("Addresses [%s]:" % len(msg.peers)) print("\n".join(msg.peers)) print("") self.latesttime = msg.time self.latestpeers = msg.peers except StateMachineError, e: errReporter.error( ("State machine error after receiving %s. Error:\n%s") % (msg, e)) self.transport.loseConnection()
def dataReceived(self, data): self.packetStorage.update(data) for rcvMsg in IterateMessages(self.packetStorage, logger, errReporter): serverSignal = self.msgToSignal(rcvMsg) self.SM.signal(serverSignal, rcvMsg)
def dataReceived(self, buf): self.__packetStorage.update(buf) for msg in IterateMessages(self.__packetStorage): self.messageReceived(msg)
def dataReceived(self, data): self.packetStorage.update(data) for rcvMsg in IterateMessages(self.packetStorage, logger, errReporter): kissSignal = self.msgToSignal(rcvMsg) print "Kiss Server Protocol: dataReceived -- kiss signal == " + kissSignal self.SM.signal(kissSignal, rcvMsg)