Revert "Add random suffix to UDS socket filename"
This reverts commit bcff44e8e1.
This commit is contained in:
parent
bcff44e8e1
commit
1a0483ff0e
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
|
||||||
|
|
||||||
import 'package:flet/flet.dart';
|
import 'package:flet/flet.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
@ -61,13 +60,6 @@ String pageUrl = "";
|
||||||
String assetsDir = "";
|
String assetsDir = "";
|
||||||
String appDir = "";
|
String appDir = "";
|
||||||
Map<String, String> environmentVariables = {};
|
Map<String, String> environmentVariables = {};
|
||||||
final _random = Random();
|
|
||||||
|
|
||||||
String _randomString(int length) {
|
|
||||||
const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
|
|
||||||
return String.fromCharCodes(Iterable.generate(
|
|
||||||
length, (_) => chars.codeUnitAt(_random.nextInt(chars.length))));
|
|
||||||
}
|
|
||||||
|
|
||||||
void main(List<String> args) async {
|
void main(List<String> args) async {
|
||||||
_args = List<String>.from(args);
|
_args = List<String>.from(args);
|
||||||
|
|
@ -201,8 +193,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
|
||||||
var socketSuffix = _randomString(8);
|
pageUrl = "flet_$pid.sock";
|
||||||
pageUrl = "flet_${pid}_$socketSuffix.sock";
|
|
||||||
environmentVariables["FLET_SERVER_UDS_PATH"] = pageUrl;
|
environmentVariables["FLET_SERVER_UDS_PATH"] = pageUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue