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

abstract_tcp_server2: restart async accept on error #3997

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

moneromooo-monero
Copy link
Collaborator

No description provided.

@@ -1003,8 +1003,23 @@ POP_WARNINGS
}else
{
_erro("Some problems at accept: " << e.message() << ", connections_count = " << m_sock_count);
misc_utils::sleep_no_w(100);
new_connection_.reset(new connection<t_protocol_handler>(io_service_, m_config, m_sock_count, m_sock_number, m_pfilter, m_connection_type));
Copy link

Choose a reason for hiding this comment

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

Since we now do this reset/accept in all three of these if/else/catch blocks, would it make sense to de-dupe those and just do it at the end of the function, once?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems it might be able to be moved from the main code after the start call etc. Not sure whether that call can take a while in specal cases, which would make the server reject connections while that's going on. The two ones on the error paths definitely can be though.

Copy link

Choose a reason for hiding this comment

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

Cool, up to you. Probably makes sense to leave the one in the main loop as-is to avoid creating any new potential issues.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd completely forgot about this. Fixed.

Copy link
Contributor

@fluffypony fluffypony left a comment

Choose a reason for hiding this comment

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

Reviewed

@fluffypony fluffypony merged commit 1a526ed into monero-project:master Jul 3, 2018
fluffypony added a commit that referenced this pull request Jul 3, 2018
1a526ed abstract_tcp_server2: restart async accept on error (moneromooo-monero)
@stoffu stoffu mentioned this pull request Aug 8, 2018
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.

3 participants