[#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(0x7fb96f52e778, 0x7fb96f52e838), requires_capability(0x7fb96edb6988, 0x7fb96edb6a48), requires_capability(0x7fb9675d9dc8, 0x7fb9675d9e88), requires_capability(0x7fb96b4f1448, 0x7fb96b4f1508), requires_capability(0x7fb95f2f2948, 0x7fb95f2f2a08), requires_capability(0x7fb96d933c48, 0x7fb96d933d08), requires_capability(0x7fb95f1f1018, 0x7fb95f1f10d8), requires_capability(0x7fb95f797f28, 0x7fb95f797fe8), requires_capability(0x7fb964e14278, 0x7fb964e14338), requires_capability(0x7fb961089cf8, 0x7fb961089db8), requires_capability(0x7fb96025c708, 0x7fb96025c7c8)]] 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]#