-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(server): join on thread when Listening drops #458
Conversation
} | ||
} | ||
} | ||
|
||
impl Listening { | ||
/// Stop the server from listening to its socket address. | ||
pub fn close(&mut self) -> HttpResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should probably take the guard for now, so that it at least lets you close a program running a server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right
b7ecdf5
to
d1d9dbf
Compare
updated |
/// The socket addresses that the server is bound to. | ||
pub socket: SocketAddr, | ||
} | ||
|
||
impl Drop for Listening { | ||
fn drop(&mut self) { | ||
match self._guard.take() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much shorter to just write self._guard.take().map(|g| let _ = g.join());
d1d9dbf
to
68d4d63
Compare
updated again |
fix(server): join on thread when Listening drops
Closes #447