[#TorControlConnection]
= TorControlConnection
:mrdocs:

Low&hyphen;level handling for Tor control connection&period; Speaks the SMTP&hyphen;like protocol as defined in torspec&sol;control&hyphen;spec&period;txt

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class TorControlConnection;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:TorControlConnection/ReplyHandlerCB.adoc[`ReplyHandlerCB`] 
| Callback type invoked with the connection and the reply it received&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:TorControlConnection/2constructor.adoc[`TorControlConnection`]         [.small]#[constructor]#
| Create a new TorControlConnection&period;
| xref:TorControlConnection/2destructor.adoc[`&#126;TorControlConnection`] [.small]#[destructor]#
| Destroy the connection, closing the socket if still open&period;
| xref:TorControlConnection/Command.adoc[`Command`] 
| Send a command, register a handler for the reply&period; A trailing CRLF is automatically added&period; Return true on success&period;
| xref:TorControlConnection/Connect.adoc[`Connect`] 
| Connect to a Tor control port&period; tor&lowbar;control&lowbar;center is address of the form host&colon;port&period; Return true on success&period;
| xref:TorControlConnection/Disconnect.adoc[`Disconnect`] 
| Disconnect from Tor control port&period;
| xref:TorControlConnection/IsConnected.adoc[`IsConnected`] 
| Check if the connection is established&period;
| xref:TorControlConnection/ReceiveAndProcess.adoc[`ReceiveAndProcess`] 
| Read available data from socket and process complete replies&period; Dispatches to registered reply handlers&period;
| xref:TorControlConnection/WaitForData.adoc[`WaitForData`] 
| Wait for data to be available on the socket&period;
|===



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