Await until all connections are closed.
Stop accepting new connections and serving requests.
If you are using server with HTTP note that WebSockets and other request without content length will be open until connection closed by a client.