Python Library Socket Protocol
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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()))