Fixed "SocketException: Failed to create server socket stdout.sock"

This commit is contained in:
Feodor Fitsner 2024-01-18 15:20:40 -08:00
parent 669f6301f8
commit 12716dec8e
1 changed files with 3 additions and 0 deletions

View File

@ -177,6 +177,9 @@ Future<String?> runPythonApp() async {
socketAddr = "$tcpAddr:${outSocketServer.port}";
} else {
socketAddr = "stdout.sock";
if (await File(socketAddr).exists()) {
await File(socketAddr).delete();
}
outSocketServer = await ServerSocket.bind(
InternetAddress(socketAddr, type: InternetAddressType.unix), 0);
debugPrint('Python output Socket Server is listening on $socketAddr');