Skip to content
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

return values missing in try_bind #1107

Open
fala13 opened this issue Oct 13, 2024 · 0 comments
Open

return values missing in try_bind #1107

fala13 opened this issue Oct 13, 2024 · 0 comments

Comments

@fala13
Copy link

fala13 commented Oct 13, 2024

try_bind doesn't return anything, contrary to it's description and doesn't seem usable at all in current form.

warp/src/server.rs

Lines 182 to 203 in 1cbf029

/// Bind to a socket address, returning a `Future` that can be
/// executed on any runtime.
///
/// In case we are unable to bind to the specified address, resolves to an
/// error and logs the reason.
pub async fn try_bind(self, addr: impl Into<SocketAddr>) {
let addr = addr.into();
let srv = match try_bind!(self, &addr) {
Ok((_, srv)) => srv,
Err(err) => {
tracing::error!("error binding to {}: {}", addr, err);
return;
}
};
srv.map(|result| {
if let Err(err) = result {
tracing::error!("server error: {}", err)
}
})
.await;
}

should probably behave like try_bind_ephemeral
https://github.com/seanmonstar/warp/blob/master/src/server.rs#L227-L247

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

1 participant