feat:初始化工程

This commit is contained in:
2025-10-27 19:05:54 +08:00
commit c85f481a18
11 changed files with 429 additions and 0 deletions

22
main.py Normal file
View File

@@ -0,0 +1,22 @@
import asyncio
from endpoint.tcp_server import TCPServer
from config.logger_config import logger
def start_tcp_server():
server = TCPServer()
try:
asyncio.run(server.start())
except KeyboardInterrupt:
logger.info("收到中断信号,正在关闭服务器...")
server.stop()
except Exception as e:
logger.error(f"服务器运行错误: {e}")
server.stop()
finally:
logger.info("服务器进程结束")
if __name__ == "__main__":
start_tcp_server()