14 #include "connectiontls.h"
15 #include "tlsdefault.h"
24 m_connection( conn ), m_tls( 0 ), m_tlsHandler( 0 ),
33 m_connection( conn ), m_tls( 0 ), m_tlsHandler( 0 ), m_log( log )
50 m_connection = connection;
70 if( !m_tls->
init( m_clientKey, m_clientCerts, m_cacerts ) )
104 return m_connection->
receive();
164 m_connection->
send( data );
An abstract base class for a connection.
virtual TLSBase * getTLSBase(TLSHandler *th, const std::string server)
virtual void handleConnect(const ConnectionBase *connection)
virtual bool encrypt(const std::string &data)=0
virtual void handleReceivedData(const ConnectionBase *connection, const std::string &data)=0
void setConnectionImpl(ConnectionBase *connection)
virtual void getStatistics(long int &totalIn, long int &totalOut)
virtual void disconnect()=0
virtual ConnectionError connect()=0
This is an abstract base class to receive events from a ConnectionBase-derived object.
virtual bool send(const std::string &data)
virtual ConnectionError receive()
virtual ConnectionBase * newInstance() const =0
virtual void handleReceivedData(const ConnectionBase *connection, const std::string &data)
virtual void handleDisconnect(const ConnectionBase *connection, ConnectionError reason)=0
The namespace for the gloox library.
const std::string & server() const
virtual bool send(const std::string &data)=0
virtual void handleConnect(const ConnectionBase *connection)=0
virtual void handleDisconnect(const ConnectionBase *connection, ConnectionError reason)
virtual ConnectionError recv(int timeout=-1)
virtual ConnectionError receive()=0
void registerConnectionDataHandler(ConnectionDataHandler *cdh)
virtual ConnectionError recv(int timeout=-1)=0
virtual void handleEncryptedData(const TLSBase *, const std::string &data)
virtual bool handshake()=0
virtual void getStatistics(long int &totalIn, long int &totalOut)=0
virtual ConnectionError connect()
ConnectionTLS(ConnectionDataHandler *cdh, ConnectionBase *conn, const LogSink &log)
virtual bool init(const std::string &clientKey=EmptyString, const std::string &clientCerts=EmptyString, const StringList &cacerts=StringList())=0
ConnectionDataHandler * m_handler
ConnectionState state() const
void log(LogLevel level, LogArea area, const std::string &message) const
virtual void handleDecryptedData(const TLSBase *, const std::string &data)
An abstract base class for TLS implementations.
virtual void disconnect()
An implementation of log sink and source.
virtual void handleHandshakeResult(const TLSBase *base, bool success, CertInfo &certinfo)
virtual ConnectionBase * newInstance() const
virtual void handleHandshakeResult(const TLSBase *base, bool success, CertInfo &certinfo)=0
virtual int decrypt(const std::string &data)=0