🐛 Trying to fix windows rpc ipc

This commit is contained in:
2025-09-11 00:33:44 +08:00
parent f0d2737da8
commit 5363afa558

View File

@@ -152,8 +152,8 @@ class ActivityRpcServer {
// Find available TCP port for Windows IPC // Find available TCP port for Windows IPC
Future<String> _findAvailableTcpPort() async { Future<String> _findAvailableTcpPort() async {
// Use ports in the range 6463-6472 (same as WebSocket server) // Use ports in the range 6473-6482 (different from WebSocket server range 6463-6472)
for (int port = 6463; port <= 6472; port++) { for (int port = 6473; port <= 6482; port++) {
try { try {
final socket = await ServerSocket.bind( final socket = await ServerSocket.bind(
InternetAddress.loopbackIPv4, InternetAddress.loopbackIPv4,
@@ -167,7 +167,7 @@ class ActivityRpcServer {
return port.toString(); // Return as string to match existing interface return port.toString(); // Return as string to match existing interface
} catch (e) { } catch (e) {
// Port not available, try next // Port not available, try next
if (port == 6463) { if (port == 6473) {
developer.log( developer.log(
'IPC TCP port $port not available: $e', 'IPC TCP port $port not available: $e',
name: kRpcIpcLogPrefix, name: kRpcIpcLogPrefix,