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

Added exception handling code. #254

Merged
merged 2 commits into from
May 13, 2019
Merged

Added exception handling code. #254

merged 2 commits into from
May 13, 2019

Conversation

redboltz
Copy link
Owner

Added missing acceptor_.reset().

Added missing `acceptor_.reset()`.
@@ -84,9 +84,25 @@ class server {
void listen() {
close_request_ = false;
renew_socket();

auto post_error =
[&](boost::system::error_code const& ec) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the lambda? It's only used in one place (inside the try-catch).

It would be simpler to call ios_accept_.post() directly, wouldn't it?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonesmz I will fix it as you pointed out.

I tried open, set_option, bind, listen, and then accept approach before, but didn't work as I expected. The lambda was used multiple times at that approach. I forgot to update it.

@redboltz redboltz merged commit 84b59ec into master May 13, 2019
@redboltz redboltz deleted the fix_re_listen_2 branch May 13, 2019 11:31
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

Successfully merging this pull request may close these issues.

2 participants