15 #ifndef CONNECTIONBASE_H__
16 #define CONNECTIONBASE_H__
19 #include "connectiondatahandler.h"
71 virtual bool send(
const std::string& data ) = 0;
83 virtual void disconnect() = 0;
109 void setServer(
const std::string &server,
int port = -1 ) { m_server = server; m_port = port; }
115 const std::string&
server()
const {
return m_server; }
121 int port()
const {
return m_port; }
140 virtual void getStatistics(
long int &totalIn,
long int &totalOut ) = 0;
167 #endif // CONNECTIONBASE_H__
An abstract base class for a connection.
virtual const std::string localInterface() const
void setServer(const std::string &server, int port=-1)
This is an abstract base class to receive events from a ConnectionBase-derived object.
The namespace for the gloox library.
const std::string & server() const
virtual int localPort() const
virtual ~ConnectionBase()
void registerConnectionDataHandler(ConnectionDataHandler *cdh)
ConnectionBase(ConnectionDataHandler *cdh)
ConnectionDataHandler * m_handler
ConnectionState state() const
const std::string EmptyString