14#ifndef CONNECTIONTCPBASE_H__
15#define CONNECTIONTCPBASE_H__
18#include "connectionbase.h"
76 virtual bool send(
const std::string& data );
88 virtual void getStatistics(
long int &totalIn,
long int &totalOut );
95 int socket()
const {
return m_socket; }
109 virtual int localPort()
const;
115 virtual const std::string localInterface()
const;
119 void init(
const std::string& server,
int port );
120 bool dataAvailable(
int timeout = -1 );
129 long int m_totalBytesIn;
130 long int m_totalBytesOut;
const std::string & server() const
ConnectionBase(ConnectionDataHandler *cdh)
This is an abstract base class to receive events from a ConnectionBase-derived object.
This is a base class for a simple TCP connection.
void setSocket(int socket)
ConnectionTCPBase(const LogSink &logInstance, const std::string &server, int port=-1)
virtual void disconnect()
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.
A simple implementation of mutex as a wrapper around a pthread mutex or a win32 critical section.
A namespace holding a couple utility functions.
The namespace for the gloox library.