15 #ifndef CONNECTIONBASE_H__
16 #define CONNECTIONBASE_H__
19 #include "connectiondatahandler.h"
71 virtual bool send(
const std::string& data ) = 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; }
An abstract base class for a connection.
virtual const std::string localInterface() const
const std::string & server() const
virtual int localPort() 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
ConnectionBase(ConnectionDataHandler *cdh)
virtual ConnectionError receive()=0
virtual void getStatistics(long int &totalIn, long int &totalOut)=0
virtual void disconnect()=0
virtual ConnectionBase * newInstance() const =0
void setServer(const std::string &server, int port=-1)
virtual ~ConnectionBase()
void registerConnectionDataHandler(ConnectionDataHandler *cdh)
This is an abstract base class to receive events from a ConnectionBase-derived object.
The namespace for the gloox library.
const std::string EmptyString