test.py 371 B

1234567891011121314
  1. from network_api import NetworkAPI
  2. import time
  3. if __name__ == "__main__":
  4. network_api = NetworkAPI(('localhost', 9998))
  5. message = '233ok'
  6. address = ('localhost', 10000)
  7. data = {
  8. "type": "client_append_entries",
  9. "timestamp": int(time.time()),
  10. "message": message,
  11. }
  12. print("send: ", data)
  13. network_api.send(data, address)