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: fix busy calling of idle IO service #3970

Merged
merged 1 commit into from
Nov 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions contrib/epee/include/net/abstract_tcp_server2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
//ask it inside(!) critical region if we still able to go in event wait...
size_t cnt = socket_.get_io_service().poll_one();
if(!cnt)
misc_utils::sleep_no_w(0);
misc_utils::sleep_no_w(1);
}

return true;
Expand Down Expand Up @@ -836,7 +836,9 @@ POP_WARNINGS
{
try
{
io_service_.run();
size_t cnt = io_service_.run();
if (cnt == 0)
misc_utils::sleep_no_w(1);
}
catch(const std::exception& ex)
{
Expand Down