dart-archive / shelf_static

archived repo
https://github.com/dart-lang/shelf/tree/master/pkgs/shelf_static
BSD 3-Clause "New" or "Revised" License
24 stars 24 forks source link

How to close the server? #65

Closed mengyanshou closed 3 years ago

mengyanshou commented 3 years ago

i use it for my flutter app,i want close the server and not close my app,any help thanks~

kevmoo commented 3 years ago

Are you running the server with your app? ctrl-c from the command line should work.

Are you running it with your IDE?

mengyanshou commented 3 years ago

In fact,I don't use it on the command line,i use it on flutter app,like speedshare,i think shelf can also support client,and it worked nice,but i can't close it by dart.

mengyanshou commented 3 years ago

i think shelf should support close invoked like HttpServer or the other server framework.

kevmoo commented 3 years ago

See https://github.com/dart-lang/samples/blob/master/server/simple/bin/server.dart#L26

You get a server instance. You can call close on it.