Add a note about closing ws with statuscode+reason

This commit is contained in:
James Wilson
2021-06-21 14:23:29 +01:00
parent 20524ac8ae
commit 06d131bf3f
+3 -1
View File
@@ -167,7 +167,9 @@ async fn handle_websocket_connection<S>(websocket: ws::WebSocket, mut tx_to_aggr
}
}
// loops ended; attempt to close the connection gracefully:
// loops ended; attempt to close the connection gracefully.
// Note: IF we want to close with a status code and reason, we need to construct
// a ws::Message using `ws::Message::close_with`, rather than using this method:
let _ = websocket.close().await;
}