Use relative socket paths instead of absolute paths

Replaced usage of absolute paths with relative socket file names for Unix domain sockets. This change simplifies socket file handling and may improve compatibility across different environments.
This commit is contained in:
Feodor Fitsner 2025-12-22 12:28:07 -08:00
parent edaf215577
commit 1d936e10eb
1 changed files with 2 additions and 2 deletions

View File

@ -198,7 +198,7 @@ Future prepareApp() async {
environmentVariables["FLET_SERVER_PORT"] = tcpPort.toString(); environmentVariables["FLET_SERVER_PORT"] = tcpPort.toString();
} else { } else {
// use UDS on other platforms // use UDS on other platforms
pageUrl = path.join(appTempPath, "flet_$pid.sock"); pageUrl = "flet_$pid.sock";
environmentVariables["FLET_SERVER_UDS_PATH"] = pageUrl; environmentVariables["FLET_SERVER_UDS_PATH"] = pageUrl;
} }
} }
@ -227,7 +227,7 @@ Future<String?> runPythonApp(List<String> args) async {
'Python output TCP Server is listening on port ${outSocketServer.port}'); 'Python output TCP Server is listening on port ${outSocketServer.port}');
socketAddr = "$tcpAddr:${outSocketServer.port}"; socketAddr = "$tcpAddr:${outSocketServer.port}";
} else { } else {
socketAddr = path.join(environmentVariables["FLET_APP_STORAGE_TEMP"]!, "stdout_$pid.sock"); socketAddr = "stdout_$pid.sock";
if (await File(socketAddr).exists()) { if (await File(socketAddr).exists()) {
await File(socketAddr).delete(); await File(socketAddr).delete();
} }