[#i2p-sam-Session-2constructor-03]
= xref:i2p.adoc[i2p]::xref:i2p/sam.adoc[sam]::xref:i2p/sam/Session.adoc[Session]::Session
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Construct a transient session which will generate its own I2P private key rather than read the one from disk (it will not be saved on disk either and will be lost once this object is destroyed)&period; This will not initiate any IO, the session will be lazily created later when first used&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:i2p/sam/Session/2constructor-02.adoc[Session](
    xref:Proxy.adoc[Proxy] const& control&lowbar;host,
    std::shared&lowbar;ptr&lt;CThreadInterrupt&gt; interrupt);
----

[.small]#xref:i2p/sam/Session/2constructor-02.adoc[_» more&period;&period;&period;_]#

Construct a session&period; This will not initiate any IO, the session will be lazily created later when first used&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:i2p/sam/Session/2constructor-00.adoc[Session](
    xref:fs/path.adoc[fs::path] const& private&lowbar;key&lowbar;file,
    xref:Proxy.adoc[Proxy] const& control&lowbar;host,
    std::shared&lowbar;ptr&lt;CThreadInterrupt&gt; interrupt);
----

[.small]#xref:i2p/sam/Session/2constructor-00.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *control&lowbar;host* [in]
| Location of the SAM proxy&period;
| *interrupt* [inout]
| If this is signaled then all operations are canceled as soon as possible and executing methods throw an exception&period;
| *private&lowbar;key&lowbar;file* [in]
| Path to a private key file&period; If the file does not exist then the private key will be generated and saved into the file&period;
|===


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