def send_push_request(self, com, message): envelope = Envelope() envelope.type = Envelope.REQ_PUSH envelope.message.dest = message.dest envelope.message.src = message.src envelope.message.payload = message.payload envelope.message.timestamp = message.timestamp com.send(envelope.SerializeToString())
def send_pull_request(self, com): envelope = Envelope() envelope.type = Envelope.REQ_PULL com.send(envelope.SerializeToString())