Skip to content

Unobvious server example #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sem-hub opened this issue Aug 11, 2021 · 2 comments
Closed

Unobvious server example #154

sem-hub opened this issue Aug 11, 2021 · 2 comments

Comments

@sem-hub
Copy link

sem-hub commented Aug 11, 2021

Could server.rs be extended to be clear how to handle errors here:
// Prepare a long-running future stream to accept and serve clients.
let incoming_tls_stream = stream! {
loop {
let (socket, _) = tcp.accept().await?;
let stream = tls_acceptor.accept(socket).map_err(|e| {
println!("[!] Voluntary server halt due to client-connection error...");
// Errors could be handled here, instead of server aborting.
// Ok(None)
error(format!("TLS Error: {:?}", e))
});
yield stream.await;
}
};

It looks impossible to return Ok(None) from map_err().

@Parth
Copy link

Parth commented Dec 12, 2021

Possible dupe: #113

That thread seems to raise some larger concerns about the concurrency too

@djc
Copy link
Member

djc commented Dec 15, 2021

Yeah, let's keep this discussion in #113.

@djc djc closed this as completed Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants