Skip to content

Commit f4bc7cd

Browse files
committed
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
1 parent 1b892dc commit f4bc7cd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

UnityMcpBridge/Editor/Helpers/PortManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public static int GetPortWithFallback()
5353
Debug.Log($"Stored port {storedConfig.unity_port} became available after short wait");
5454
return storedConfig.unity_port;
5555
}
56+
// Prefer sticking to the same port; let the caller handle bind retries/fallbacks
57+
return storedConfig.unity_port;
5658
}
5759

5860
// If no valid stored port, find a new one and save it

0 commit comments

Comments
 (0)