close method Null safety

Future close()

Closes this HTTP server and channel.

Implementation

Future close() async {
  logger.fine("ApplicationServer($identifier).close Closing HTTP listener");
  if (server != null) {
    await server!.close(force: true);
  }
  logger.fine("ApplicationServer($identifier).close Closing channel");
  await channel.close();

  // This is actually closed by channel.messageHub.close, but this shuts up the analyzer.
  hubSink?.close();
  logger.fine("ApplicationServer($identifier).close Closing complete");
}