reorganize application code into fiveparaminte-main directory structure

This commit is contained in:
2026-09-17 14:30:02 +05:30
parent 1b1b382f3e
commit 68bda2519f
16 changed files with 1080 additions and 379 deletions
+16
View File
@@ -62,6 +62,22 @@ def _get_local_ips():
@asynccontextmanager
async def lifespan(app: FastAPI):
# Protect against Windows IOCP Proactor crashes (WinError 64 / 121 / 10054 on accept)
import sys
if sys.platform == "win32":
try:
loop = asyncio.get_running_loop()
def silence_windows_iocp_errors(loop, context):
msg = str(context.get("message", ""))
exc = context.get("exception")
winerr = getattr(exc, "winerror", None)
if winerr in (64, 121, 10054) or "Accept failed on a socket" in msg or "The specified network name is no longer available" in msg:
return
loop.default_exception_handler(context)
loop.set_exception_handler(silence_windows_iocp_errors)
except Exception:
pass
servers = []
# === Start Contec CMS7000PLUS TCP Servers ===