start method

dynamic start()

Implementation

start() async {
  final server = await HttpServer.bind(InternetAddress.anyIPv4, 9898);
  Logger.info('调试服务器已启动,IP = 127.0.0.1,端口 = 9898');
  _server = server;
  await for (HttpRequest request in server) {
    final socket = await WebSocketTransformer.upgrade(request);
    _activeClient = socket;
    Logger.info('调试宿主已连接');
    notifyListeners();
    socket.listen((message) {
      receiveMethodResponse(message);
    });
    socket.done.then((value) {
      Logger.info('调试宿主已断开');
      socket.close();
      _activeClient = null;
      notifyListeners();
    });
  }
}