mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
net: isolate the protocol-agnostic part of CConnman::AcceptConnection()
Isolate the second half of `CConnman::AcceptConnection()` into a new separate method, which could be reused if we accept incoming connections by other means than `accept()` (first half of `CConnman::AcceptConnection()`).
This commit is contained in:
14
src/net.h
14
src/net.h
@@ -1049,6 +1049,20 @@ private:
|
||||
void ThreadOpenConnections(std::vector<std::string> connect);
|
||||
void ThreadMessageHandler();
|
||||
void AcceptConnection(const ListenSocket& hListenSocket);
|
||||
|
||||
/**
|
||||
* Create a `CNode` object from a socket that has just been accepted and add the node to
|
||||
* the `vNodes` member.
|
||||
* @param[in] hSocket Connected socket to communicate with the peer.
|
||||
* @param[in] permissionFlags The peer's permissions.
|
||||
* @param[in] addr_bind The address and port at our side of the connection.
|
||||
* @param[in] addr The address and port at the peer's side of the connection.
|
||||
*/
|
||||
void CreateNodeFromAcceptedSocket(SOCKET hSocket,
|
||||
NetPermissionFlags permissionFlags,
|
||||
const CAddress& addr_bind,
|
||||
const CAddress& addr);
|
||||
|
||||
void DisconnectNodes();
|
||||
void NotifyNumConnectionsChanged();
|
||||
/** Return true if the peer is inactive and should be disconnected. */
|
||||
|
||||
Reference in New Issue
Block a user