| | |
| | | SERVER_IP = "127.0.0.1" |
| | | SERVER_PORT = 10008 |
| | | |
| | | |
| | | class SendResponseSkManager: |
| | | __send_response_sk_dict = {} |
| | | |
| | |
| | | pass |
| | | |
| | | @classmethod |
| | | def create_send_response_sk(cls): |
| | | addr, port = SERVER_IP, SERVER_PORT |
| | | def create_send_response_sk(cls, addr=SERVER_IP, port=SERVER_PORT): |
| | | client = socket.socket() # 生成socket,连接server |
| | | client.connect((addr, port)) |
| | | return client |
| | |
| | | |
| | | import dask |
| | | import psutil |
| | | import huaxin_api.constant |
| | | from line_profiler import LineProfiler |
| | | |
| | | import constant |
| | |
| | | class OutsideApiCommandCallback(outside_api_command_manager.ActionCallback): |
| | | @classmethod |
| | | def __send_response(cls, data_bytes): |
| | | sk = SendResponseSkManager.create_send_response_sk() |
| | | sk = SendResponseSkManager.create_send_response_sk(addr=huaxin_api.constant.SERVER_IP, |
| | | port=huaxin_api.constant.SERVER_PORT) |
| | | try: |
| | | data_bytes = socket_util.load_header(data_bytes) |
| | | sk.sendall(data_bytes) |