Adding as usual where it applies:
scope (exit)
{
listener.stopListening();
}
is not sufficient to close a vibe.d program gracefully by means of Ctrl+C when it also make use of Websocket implemented like so:
routes.get("/ws", handleWebSockets(&handleWebSocketConnection));
routes being an instance of URLRouter and the related handler looks like so
void handleWebSocketConnection(scope WebSocket socket)
{
...
while (true) {
...
if (!socket.connected) break;
...
socket.send("xxxx");
}
...
}