from websocket import create_connection
    # 建立一个websocket连接
    ws = create_connection("ws://{}:7505/realtime/logs".format(server_ip))
    # 对websocket客户端发送一个请求
    print task_id
    ws.send('{{"type":"1","taskId":{},"source":"1"}}'.format(task_id))
    # 接收返回的数据

    while 1:
        result = ws.recv()
        print(str(result))
        if 'Task status: success' in str(result) and 'Current time:' in str(result):
            ws.close()
            success=True
            break
        elif 'Task status: ' in str(result) and 'Current time:' in str(result):
            ws.close()
            success = False
            break

  

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2021-11-20
  • 2021-11-18
猜你喜欢
  • 2022-02-09
  • 2022-12-23
  • 2021-11-20
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
相关资源
相似解决方案