def onConnectionLost(self, failedByMe): Case.onConnectionLost(self, failedByMe) if self.behaviorClose == Case.WRONG_CODE: self.behavior = Case.FAILED self.passed = False self.result = self.resultClose
def onConnectionLost(self, failedByMe): Case.onConnectionLost(self, failedByMe) self.passed = True self.behavior = Case.INFORMATIONAL self.behaviorClose = Case.INFORMATIONAL self.result = "Actual events are undefined by the spec."
def onConnectionLost(self, failedByMe): Case.onConnectionLost(self, failedByMe) if self.behaviorClose == Case.WRONG_CODE: self.behavior = Case.FAILED self.passed = False self.result = self.resultClose ## the close reason we sent was invalid UTF8, so we ## convert to HEX representation for later case reporting self.p.localCloseReason = binascii.b2a_hex(self.p.localCloseReason)
def onConnectionLost(self, failedByMe): Case.onConnectionLost(self, failedByMe) self.passed = True if self.behavior == Case.OK: self.result = "Text message was processed before close." elif self.behavior == Case.NON_STRICT: self.result = "Close was processed before text message could be returned." self.behavior = Case.INFORMATIONAL self.behaviorClose = Case.INFORMATIONAL
def onConnectionLost(self, failedByMe): Case.onConnectionLost(self, failedByMe) frames_expected = {} frames_expected[0] = len(self.payload) / self.p.autoFragmentSize frames_expected[1] = 1 if len(self.payload) % self.p.autoFragmentSize > 0 else 0 frames_got = {} frames_got[0] = self.p.txFrameStats[0] frames_got[1] = self.p.txFrameStats[1] if frames_expected == frames_got: pass else: self.behavior = Case.FAILED self.result = "Frames transmitted %s does not match what we expected %s." % (str(frames_got), str(frames_expected))
def onConnectionLost(self, failedByMe): self.producer.stopProducing() Case.onConnectionLost(self, failedByMe)