In example-service, print the port the server is listened on.

This is helpful when passing starting the server with --port 0.
This commit is contained in:
Tim Kuehn
2022-10-06 20:58:54 -07:00
parent 49ba8f8b1b
commit 863a08d87e

View File

@@ -54,6 +54,7 @@ async fn main() -> anyhow::Result<()> {
// JSON transport is provided by the json_transport tarpc module. It makes it easy
// to start up a serde-powered json serialization strategy over TCP.
let mut listener = tarpc::serde_transport::tcp::listen(&server_addr, Json::default).await?;
tracing::info!("Listening on port {}", listener.local_addr().port());
listener.config_mut().max_frame_length(usize::MAX);
listener
// Ignore accept errors.