-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Conversation
@@ -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)); |
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.
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?
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.
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.
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.
Cool, up to you. Probably makes sense to leave the one in the main loop as-is to avoid creating any new potential issues.
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.
I'd completely forgot about this. Fixed.
6e58811
to
1a526ed
Compare
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.
Reviewed
1a526ed abstract_tcp_server2: restart async accept on error (moneromooo-monero)
No description provided.