[#CConnman-OpenNetworkConnection] = xref:CConnman.adoc[CConnman]::OpenNetworkConnection :relfileprefix: ../ :mrdocs: Open a new P2P connection and initialize it with the PeerManager at `m_msgproc`. == Synopsis Declared in `<net.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[requires_capability(0x7ff36f780bb8, 0x7ff36f780c78), requires_capability(0x7ff36f467428, 0x7ff36f4674e8), requires_capability(0x7ff37f4069e8, 0x7ff37f406aa8), requires_capability(0x7ff3775637b8, 0x7ff377563878), requires_capability(0x7ff37b69ecb8, 0x7ff37b69ed78), requires_capability(0x7ff37e1c68e8, 0x7ff37e1c69a8), requires_capability(0x7ff379a7ce38, 0x7ff379a7cef8), requires_capability(0x7ff36f4a3e78, 0x7ff36f4a3f38), requires_capability(0x7ff37bc14ad8, 0x7ff37bc14b98), requires_capability(0x7ff3814a4aa8, 0x7ff3814a4b68), requires_capability(0x7ff3666cbb28, 0x7ff3666cbbe8)]] bool OpenNetworkConnection( xref:CAddress.adoc[CAddress] const& addrConnect, bool fCountFailure, xref:CountingSemaphoreGrant.adoc[CountingSemaphoreGrant<>]&& grant_outbound, char const* pszDest, xref:ConnectionType.adoc[ConnectionType] conn_type, bool use_v2transport, std::optional<Proxy> const& proxy_override); ---- == Return Value whether the connection was opened successfully. == Parameters [cols="1,4"] |=== | Name| Description | *addrConnect* [in] | Address to connect to, if `pszDest` is `nullptr`. | *fCountFailure* [in] | Increment the number of connection attempts to this address in Addrman. | *grant_outbound* [in] | Take ownership of this grant, to be released later when the connection is closed. | *pszDest* [in] | Address to resolve and connect to. | *conn_type* [in] | Type of the connection to open, must not be `ConnectionType::INBOUND`. | *use_v2transport* [in] | Use P2P encryption, (aka V2 transport, BIP324). | *proxy_override* [in] | Optional proxy to use and override normal proxy selection. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#