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 553B

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