Problem
ServerLoop awaits ProcessWebSocket(context) inline, so one long-lived WebSocket connection prevents the listener from accepting new contexts.
Evidence
Editor/MCPServer.Networking.cs:100-104 waits for GetContextAsync() then calls await ProcessWebSocket(context) for WebSocket requests.
- HTTP requests are dispatched with fire-and-forget
Task.Run, but WebSocket requests are not.
Impact
A connected WebSocket client can starve concurrent HTTP JSON-RPC clients or new WebSocket connections because the accept loop does not continue until the WebSocket receive loop exits.
Suggested fix
Dispatch each WebSocket handler independently like HTTP requests, or reject additional connections explicitly while preserving the accept loop. Track/cancel spawned tasks during shutdown if needed.
Source report
Imported from audit report item: resource-leak (9) / Editor/MCPServer.Networking.cs:102.
Problem
ServerLoopawaitsProcessWebSocket(context)inline, so one long-lived WebSocket connection prevents the listener from accepting new contexts.Evidence
Editor/MCPServer.Networking.cs:100-104waits forGetContextAsync()then callsawait ProcessWebSocket(context)for WebSocket requests.Task.Run, but WebSocket requests are not.Impact
A connected WebSocket client can starve concurrent HTTP JSON-RPC clients or new WebSocket connections because the accept loop does not continue until the WebSocket receive loop exits.
Suggested fix
Dispatch each WebSocket handler independently like HTTP requests, or reject additional connections explicitly while preserving the accept loop. Track/cancel spawned tasks during shutdown if needed.
Source report
Imported from audit report item:
resource-leak (9)/Editor/MCPServer.Networking.cs:102.