Final version

This commit is contained in:
Alessandro Autiero
2023-09-21 16:48:31 +02:00
parent 4bba21c038
commit 73c1cc8526
90 changed files with 3204 additions and 2608 deletions

View File

@@ -5,6 +5,7 @@ import 'package:fluent_ui/fluent_ui.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:reboot_common/common.dart';
import 'package:reboot_launcher/src/page/abstract/page_type.dart';
import 'package:sync/semaphore.dart';
abstract class ServerController extends GetxController {
@@ -15,6 +16,7 @@ abstract class ServerController extends GetxController {
late final Semaphore semaphore;
late RxBool started;
late RxBool detached;
StreamSubscription? worker;
int? embeddedServerPid;
HttpServer? localServer;
HttpServer? remoteServer;
@@ -58,6 +60,8 @@ abstract class ServerController extends GetxController {
Future<bool> get isPortTaken async => !(await isPortFree);
RebootPageType get pageType;
Future<bool> freePort();
@protected
@@ -196,15 +200,6 @@ abstract class ServerController extends GetxController {
}
}
Stream<ServerResult> restart() async* {
await resetWinNat();
if(started()) {
yield* stop();
}
yield* start();
}
Stream<ServerResult> toggle() async* {
if(started()) {
yield* stop();