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

refactor: backport bitcoin#24356, extend -socketevents to Sock, implement Sock::WaitMany{Epoll, KQueue} #6018

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
6 changes: 3 additions & 3 deletions src/i2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ bool Session::Accept(Connection& conn)
throw std::runtime_error("wait on socket failed");
}

if ((occurred & Sock::RECV) == 0) {
// Timeout, no incoming connections within MAX_WAIT_FOR_IO.
if (occurred == 0) {
// Timeout, no incoming connections or errors within MAX_WAIT_FOR_IO.
continue;
}

Expand Down Expand Up @@ -295,7 +295,7 @@ Session::Reply Session::SendRequestAndGetReply(const Sock& sock,

std::unique_ptr<Sock> Session::Hello() const
{
auto sock = CreateSock(m_control_host);
auto sock = CreateSock(m_control_host, SocketEventsMode::Select, /* fd_mode = */ std::nullopt);

if (!sock) {
throw std::runtime_error("Cannot create socket");
Expand Down
2 changes: 1 addition & 1 deletion src/masternode/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void CActiveMasternodeManager::InitInternal(const CBlockIndex* pindex)

// Check socket connectivity
LogPrintf("CActiveMasternodeManager::Init -- Checking inbound connection to '%s'\n", m_info.service.ToStringAddrPort());
std::unique_ptr<Sock> sock = CreateSock(m_info.service);
std::unique_ptr<Sock> sock = CreateSock(m_info.service, SocketEventsMode::Select, /* fd_mode = */ std::nullopt);
if (!sock) {
m_state = MASTERNODE_ERROR;
m_error = "Could not create socket to connect to " + m_info.service.ToStringAddrPort();
Expand Down
Loading
Loading