Skip to content

Commit 097858f

Browse files
committed
Update example: Restart server instead of abort
You don't want to restart sample server everytime it aborts :)
1 parent 5dec3f9 commit 097858f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/server.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ use tokio_rustls::server::TlsStream;
2020
use tokio_rustls::TlsAcceptor;
2121

2222
fn main() {
23-
// Serve an echo service over HTTPS, with proper error handling.
24-
if let Err(e) = run_server() {
25-
eprintln!("FAILED: {}", e);
26-
std::process::exit(1);
23+
loop {
24+
// Serve an echo service over HTTPS, with proper error handling.
25+
if let Err(e) = run_server() {
26+
eprintln!("FAILED: {}", e);
27+
}
2728
}
2829
}
2930

0 commit comments

Comments
 (0)