#include <connectiontls.h>
Inherits TLSHandler, ConnectionBase, and ConnectionDataHandler.
Inheritance diagram for ConnectionTLS:

Public Member Functions | |
| ConnectionTLS (ConnectionBase *conn, ConnectionDataHandler *cdh, const LogSink &log) | |
| virtual | ~ConnectionTLS () |
| virtual ConnectionError | connect () |
| virtual ConnectionError | recv (int timeout=-1) |
| virtual bool | send (const std::string &data) |
| virtual ConnectionError | receive () |
| virtual void | disconnect () |
| virtual void | cleanup () |
| virtual void | getStatistics (int &totalIn, int &totalOut) |
| virtual void | handleReceivedData (const ConnectionBase *connection, const std::string &data) |
| virtual void | handleConnect (const ConnectionBase *connection) |
| virtual void | handleDisconnect (const ConnectionBase *connection, ConnectionError reason) |
| virtual ConnectionBase * | newInstance () const |
| virtual void | handleEncryptedData (const TLSBase *, const std::string &data) |
| virtual void | handleDecryptedData (const TLSBase *, const std::string &data) |
| virtual void | handleHandshakeResult (const TLSBase *base, bool success, CertInfo &certinfo) |
Usage:
Client *c = new Client( ... ); c->setConnectionImpl( new ConnectionTLS( c, new ConnectionTCP( c->logInstance(), server, port ), c->logInstance()) );
Due to the need for handshaking data to be sent/received before the connection is fully established, be sure not to use the connection until ConnectionDataHandler::handleConnect() of the specified ConnectionDataHandler is called.
Definition at line 46 of file connectiontls.h.
|
||||||||||||||||
|
Constructs a new ConnectionTLS object.
Definition at line 20 of file connectiontls.cpp. |
|
|
Virtual Destructor. Definition at line 29 of file connectiontls.cpp. |
|
|
This function is called after a disconnect to clean up internal state. It is also called by ConnectionBase's destructor. Reimplemented from ConnectionBase. Definition at line 98 of file connectiontls.cpp. |
|
|
Used to initiate the connection.
Implements ConnectionBase. Definition at line 36 of file connectiontls.cpp. |
|
|
Disconnects an established connection. NOOP if no active connection exists. Implements ConnectionBase. Definition at line 89 of file connectiontls.cpp. |
|
||||||||||||
|
Returns current connection statistics.
Implements ConnectionBase. Definition at line 103 of file connectiontls.cpp. |
|
|
This function is called when e.g. the raw TCP connection was established.
Implements ConnectionDataHandler. Definition at line 124 of file connectiontls.cpp. |
|
||||||||||||
|
Reimplement this function to receive decrypted data from a TLSBase implementation.
Implements TLSHandler. Definition at line 150 of file connectiontls.cpp. |
|
||||||||||||
|
This connection is called when e.g. the raw TCP connection was closed.
Implements ConnectionDataHandler. Definition at line 133 of file connectiontls.cpp. |
|
||||||||||||
|
Reimplement this function to receive encrypted data from a TLSBase implementation.
Implements TLSHandler. Definition at line 143 of file connectiontls.cpp. |
|
||||||||||||||||
|
Reimplement this function to receive the result of a TLS handshake.
Implements TLSHandler. Definition at line 163 of file connectiontls.cpp. |
|
||||||||||||
|
This function is called for received from the underlying transport.
Implements ConnectionDataHandler. Definition at line 118 of file connectiontls.cpp. |
|
|
This function returns a new instance of the current ConnectionBase-derived object. The idea is to be able to 'clone' ConnectionBase-derived objects without knowing of what type they are exactly.
Implements ConnectionBase. Definition at line 108 of file connectiontls.cpp. |
|
|
Use this function to put the connection into 'receive mode', i.e. this function returns only when the connection is terminated.
Implements ConnectionBase. Definition at line 81 of file connectiontls.cpp. |
|
|
Use this periodically to receive data from the socket and to feed the parser.
Implements ConnectionBase. Definition at line 50 of file connectiontls.cpp. |
|
|
Use this function to send a string of data over the wire. The function returns only after all data has been sent.
Implements ConnectionBase. Definition at line 64 of file connectiontls.cpp. |
1.4.1