# from hub import methods, Global import struct import asyncio import time # from concurrent.futures import ThreadPoolExecutor import sys import importlib # --- for linux sys.path.append('/home/server/repositories/repositories/sri-project.demo-py/sri-server-bg03') sys.path.append('/home/server/repositories/repositories/sri-project.demo-py/3rdparty') protobuf = importlib.import_module(f"xprotobuf.protocol_pb2") methods = importlib.import_module(f"xlib") class SRIConnection(asyncio.Protocol): """""" # head_sequence = ': (socket, update_at, type)} | {<连接id>: (socket对象, 最后一次请求时间, 客户端类型)} # executor = ThreadPoolExecutor() clients = {} # {: (socket, update_at, type)} | {<连接id>: (socket对象, 最后一次请求时间, 客户端类型)} def connection_made(self, client): self.client = client self.peername = client.get_extra_info('peername') print(f"Connection from {self.peername}") # --- 自定义参数 self.head_sequence = '