-
Notifications
You must be signed in to change notification settings - Fork 19
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
Timeouts in operations with sockets #417
base: master
Are you sure you want to change the base?
Conversation
30f920d
to
83e4230
Compare
@@ -18,8 +21,10 @@ namespace http_client | |||
/// @brief Connects the socket to the given endpoints | |||
/// @param endpoints The endpoints to connect to | |||
/// @param ec The error code, if any occurred | |||
virtual void Connect(const boost::asio::ip::tcp::resolver::results_type& endpoints, | |||
boost::system::error_code& ec) = 0; | |||
virtual void Connect(boost::asio::io_context& io_context, |
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.
Add missing parameters to function description.
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.
Done
/// @param endpoints The endpoints to connect to | ||
/// @param ec The error code, if any occurred | ||
void Connect(const boost::asio::ip::tcp::resolver::results_type& endpoints, | ||
boost::system::error_code& ec) override | ||
void Connect(boost::asio::io_context& io_context, |
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.
Same.
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.
Done
@@ -27,24 +27,54 @@ namespace http_client | |||
/// @brief Connects the socket to the given endpoints | |||
/// @param endpoints The endpoints to connect to | |||
/// @param ec The error code, if any occurred | |||
void Connect(const boost::asio::ip::tcp::resolver::results_type& endpoints, | |||
boost::system::error_code& ec) override | |||
void Connect(boost::asio::io_context& io_context, |
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.
Same.
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.
Done
Adds timeout to Connect() function
bfdaee3
to
c6db8be
Compare
HttpsSocket will be addressed in later commit.
c6db8be
to
a6ba4f4
Compare
Description
This PR adds timeouts to socket operations that can block the process/co_routine indefinitely.