Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

How to close this service? The close method has no effect #40

Open
lalLAL95828 opened this issue Dec 20, 2021 · 0 comments
Open

How to close this service? The close method has no effect #40

lalLAL95828 opened this issue Dec 20, 2021 · 0 comments

Comments

@lalLAL95828
Copy link

  @override
  void initState() {
    super.initState();
    shelf_io.serve(handler, '10.0.2.15',3534).then((server) {
        _httpServer = server;
        setState(() {});
      }).catchError((err){
        print(err);
        setState(() {});
      });
  }

When I create a connection in initstate and then execute the close method in dispose, the service that the client has connected will not be disconnected

@override
  void dispose() {
    _httpServer?.close(force:true);
    super.dispose();
  }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant