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 )
53 m_connection = connection;
73 if( !m_tls->
init( m_clientKey, m_clientCerts, m_cacerts ) )
107 return m_connection->
receive();
167 m_connection->
send( data );
An abstract base class for a connection.
const std::string & server() const
ConnectionState state() const
virtual ConnectionError recv(int timeout=-1)=0
virtual bool send(const std::string &data)=0
ConnectionDataHandler * m_handler
virtual ConnectionError connect()=0
virtual ConnectionError receive()=0
virtual void getStatistics(long int &totalIn, long int &totalOut)=0
virtual void disconnect()=0
virtual ConnectionBase * newInstance() const =0
void registerConnectionDataHandler(ConnectionDataHandler *cdh)
This is an abstract base class to receive events from a ConnectionBase-derived object.
virtual void handleReceivedData(const ConnectionBase *connection, const std::string &data)=0
virtual void handleDisconnect(const ConnectionBase *connection, ConnectionError reason)=0
virtual void handleConnect(const ConnectionBase *connection)=0
virtual void handleEncryptedData(const TLSBase *, const std::string &data)
ConnectionTLS(ConnectionDataHandler *cdh, ConnectionBase *conn, const LogSink &log)
virtual void handleDisconnect(const ConnectionBase *connection, ConnectionError reason)
virtual ConnectionError recv(int timeout=-1)
virtual void handleConnect(const ConnectionBase *connection)
virtual void handleReceivedData(const ConnectionBase *connection, const std::string &data)
virtual void disconnect()
virtual void handleDecryptedData(const TLSBase *, const std::string &data)
virtual ConnectionBase * newInstance() const
virtual ConnectionError connect()
virtual TLSBase * getTLSBase(TLSHandler *th, const std::string server)
void setConnectionImpl(ConnectionBase *connection)
virtual void handleHandshakeResult(const TLSBase *base, bool success, CertInfo &certinfo)
virtual bool send(const std::string &data)
virtual ConnectionError receive()
virtual void getStatistics(long int &totalIn, long int &totalOut)
An implementation of log sink and source.
void log(LogLevel level, LogArea area, const std::string &message) const
An abstract base class for TLS implementations.
virtual bool encrypt(const std::string &data)=0
virtual int decrypt(const std::string &data)=0
virtual bool init(const std::string &clientKey=EmptyString, const std::string &clientCerts=EmptyString, const StringList &cacerts=StringList())=0
virtual bool handshake()=0
virtual void handleHandshakeResult(const TLSBase *base, bool success, CertInfo &certinfo)=0
The namespace for the gloox library.
@ LogAreaClassConnectionTLS