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
WIP: switch to libevent for node socket handling #11227
Commits on Sep 20, 2017
-
-
-
-
-
net: when de-activating p2p, set nodes to be disconnected rather than…
… closing the socket immediately Messing with the socket from a non-network thread adds unnecessary complexity.
-
net: Add a Disconnect function for nodes
For now, this just sets fDisconnect like before. But a function will be necessary later.
-
scripted-diff: Call Disconnect rather than setting fDisconnect directly
-BEGIN VERIFY SCRIPT- sed -i 's/fDisconnect = true/Disconnect()/' src/net.cpp src/net_processing.cpp -END VERIFY SCRIPT-
-
net: add an EnableReceive function so that the message handler can tr…
…igger it for now this just disables fPauseRecv, but it will need to be a function later.
-
net: get rid of optimistic send and the socket lock
The socket lock only existed because it was possible to trigger an immediate disconnect via threads other than the socket handler. The optimistic send was the last offender.
-
-
-
-
-
net: pass the socket/whitelist args directly to AcceptConnection
Subsequent changes will turn AcceptConnection into a callback where the socket is one of the supplied params.
-
net: add an event handler for future read/write callbacks
For now this just handles read/write/error/timeout conditions for each node serially, but OnEvents will soon be invoked as a callback when socket status changes.
-
net: Only close the socket in once place
By only allowing the socket to be closed and the handle to be invalidated in one place, it becomes much easier to reason about the status at any given time.
-
-
Net: handle all new connections on the socket handler thread
This ensures that outgoing connections don't race with event teardown at shutdown.