From 2af436382e707e5ded6d3049bd8c2bd36e899f72 Mon Sep 17 00:00:00 2001 From: "build@lguplus.co.kr" Date: Thu, 11 Jan 2024 15:52:13 +0900 Subject: [PATCH] update server file --- lib/socket/protobuf_server.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/socket/protobuf_server.dart b/lib/socket/protobuf_server.dart index 0add61b..70b17e0 100644 --- a/lib/socket/protobuf_server.dart +++ b/lib/socket/protobuf_server.dart @@ -9,10 +9,13 @@ import 'package:protobuf/protobuf.dart'; abstract class ProtobufServer { List _clientList = []; + bool _started = false; late ServerSocket? _server; final String _host; final int _port; final ProtobufClient Function(Socket) _createNewClient; + + bool get started => _started; ProtobufServer(this._host, this._port, this._createNewClient); @@ -25,6 +28,7 @@ abstract class ProtobufServer client.addListener(onTemplateData); _clientList.add(client); onClientConnected(client); + _started = true; }); return simpleFuture; } @@ -56,5 +60,7 @@ abstract class ProtobufServer Future stop() async { await _server?.close(); + _started = false; + return simpleFuture; } }