Skip to content
This repository has been archived by the owner on Sep 13, 2018. It is now read-only.

TcpServer::serve() calls unwrap making it impossible to handle the error #163

Open
cardoe opened this issue May 8, 2017 · 3 comments
Open

Comments

@cardoe
Copy link

cardoe commented May 8, 2017

TcpServer::serve() calls unwrap() when bind/setting up the socket and does not return the error or let the user handle the error in anyway. A link to the line in question is here: https://github.com/tokio-rs/tokio-proto/blob/master/src/tcp_server.rs#L187

This makes it impossible to gracefully handle situations when the socket might already be in use.

@sector-f
Copy link

This strikes me as "unprofessional," for lack of a better word. That is, I can't see myself actually allowing panics to reach an end user, but apparently tokio-proto doesn't give you a choice in that matter.

@cardoe
Copy link
Author

cardoe commented Nov 19, 2017

There's been a bunch of talk around 0.2, I'm hoping this can get addressed for that API bump.

@carllerche
Copy link
Member

tokio-proto is on the back burner right now in favor of tokio-core (renamed tokio) and tokio. The RFC talks about this a bit. I doubt this will be fixed anytime soon as there isn't much in the way of time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants