close method
close http server
server.close();
Implementation
Future<void> close({bool force = false}) async {
StrictMode.stopWatchdog();
_main = null;
List<HttpServer> all = _open;
_open = <HttpServer>[];
try {
// all ports stop taking connections at the same time, also when
// one of them waits for its open connections
await Future.wait(<Future<void>>[
for (HttpServer s in all) s.close(force: force).then(_ignore),
]);
} finally {
_closed();
}
}