def METHOD_NAME(self, msg, binary):
    if self.factory.endCaseId is None:
        self.factory.endCaseId = int(msg)
        self.log.info("Ok, will run {case_count} cases", case_count=self.factory.endCaseId)
    else:
        if self.state == WebSocketProtocol.STATE_OPEN:
            self.sendMessage(msg, binary)