import json import socket import requests from code_attribute.code_price_manager import CodesLimitRateManager from utils import tool, socket_util from utils.block_web_api import THSBlocksApi from utils.history_k_data_util import HistoryKDatasUtils if __name__ == "__main__": client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 生成socket,连接server # client.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, True) # client.ioctl(socket.SIO_KEEPALIVE_VALS, (1, 60 * 1000, 30 * 1000)) client.connect(("192.168.3.122", 10009)) client.sendall(socket_util.load_header( json.dumps({"type": "push_msg", "data": {"type": "update_position"}}).encode("utf-8")))