From f4bc7cd4fded943881c9e7d16271a802eb3ae400 Mon Sep 17 00:00:00 2001 From: David Sarno Date: Fri, 8 Aug 2025 08:37:02 -0700 Subject: [PATCH] fix(ports): never hop to default when stored port busy; prefer stored port and let bind micro-retry handle release to avoid port swapping on recompiles --- UnityMcpBridge/Editor/Helpers/PortManager.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UnityMcpBridge/Editor/Helpers/PortManager.cs b/UnityMcpBridge/Editor/Helpers/PortManager.cs index 9e12e7a..9caeccc 100644 --- a/UnityMcpBridge/Editor/Helpers/PortManager.cs +++ b/UnityMcpBridge/Editor/Helpers/PortManager.cs @@ -53,6 +53,8 @@ namespace UnityMcpBridge.Editor.Helpers Debug.Log($"Stored port {storedConfig.unity_port} became available after short wait"); return storedConfig.unity_port; } + // Prefer sticking to the same port; let the caller handle bind retries/fallbacks + return storedConfig.unity_port; } // If no valid stored port, find a new one and save it