Python Library Socket Protocol
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

socket_protocol_client.py 447B

1234567891011121314
  1. import sys
  2. sys.path.append('../..')
  3. import report
  4. import socket_protocol
  5. import tcp_socket
  6. import time
  7. report.stdoutLoggingConfigure(log_name_lvl=[('root', 'INFO'), ])
  8. c = tcp_socket.tcp_client_stp('127.0.0.1', 17017)
  9. sp = socket_protocol.pure_json_protocol(c, channel_name='example_client')
  10. sp.send(socket_protocol.SID_READ_REQUEST, 0, None)
  11. print('The Client received: %s' % repr(sp.receive(socket_protocol.SID_READ_RESPONSE, 0).get_data()))