[#CConnman-AddConnection]
= xref:CConnman.adoc[CConnman]::AddConnection
:relfileprefix: ../
:mrdocs:

Attempts to open a connection&period; Currently only used from tests&period;

== Synopsis

Declared in `&lt;net&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f2e2b749810, 0x7f2e2b7498d0), requires&lowbar;capability(0x7f2e28942520, 0x7f2e289425e0), requires&lowbar;capability(0x7f2e234d1700, 0x7f2e234d17c0), requires&lowbar;capability(0x7f2e2737dea0, 0x7f2e2737df60), requires&lowbar;capability(0x7f2e235ef530, 0x7f2e235ef5f0), requires&lowbar;capability(0x7f2e2a34b620, 0x7f2e2a34b6e0), requires&lowbar;capability(0x7f2e219f83f0, 0x7f2e219f84b0), requires&lowbar;capability(0x7f2e21c832b0, 0x7f2e21c83370), requires&lowbar;capability(0x7f2e1aa35e10, 0x7f2e1aa35ed0), requires&lowbar;capability(0x7f2e376b7ef0, 0x7f2e376b7fb0), requires&lowbar;capability(0x7f2e433cda80, 0x7f2e433cdb40)&rsqb;&rsqb;
bool
AddConnection(
    std::string const& address,
    xref:ConnectionType.adoc[ConnectionType] conn&lowbar;type,
    bool use&lowbar;v2transport);
----

== Return Value

bool Returns false if there are no available slots for this connection&colon; &hyphen; conn&lowbar;type not a supported ConnectionType &hyphen; Max total outbound connection capacity filled &hyphen; Max connection capacity for type is filled

== Parameters

[cols="1,4"]
|===
| Name| Description
| *address* [in]
| Address of node to try connecting to
| *conn&lowbar;type* [in]
| ConnectionType&colon;&colon;OUTBOUND, ConnectionType&colon;&colon;BLOCK&lowbar;RELAY, ConnectionType&colon;&colon;ADDR&lowbar;FETCH or ConnectionType&colon;&colon;FEELER
| *use&lowbar;v2transport* [in]
| Set to true if node attempts to connect using BIP 324 v2 transport protocol&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
