gloox
1.0.28
|
#include <connectiontcpclient.h>
Public Member Functions | |
ConnectionTCPClient (const LogSink &logInstance, const std::string &server, int port=-1) | |
ConnectionTCPClient (ConnectionDataHandler *cdh, const LogSink &logInstance, const std::string &server, int port=-1) | |
virtual | ~ConnectionTCPClient () |
virtual ConnectionError | recv (int timeout=-1) |
virtual ConnectionError | connect () |
virtual ConnectionBase * | newInstance () const |
Public Member Functions inherited from ConnectionTCPBase | |
ConnectionTCPBase (const LogSink &logInstance, const std::string &server, int port=-1) | |
ConnectionTCPBase (ConnectionDataHandler *cdh, const LogSink &logInstance, const std::string &server, int port=-1) | |
virtual | ~ConnectionTCPBase () |
virtual bool | send (const std::string &data) |
virtual ConnectionError | receive () |
virtual void | disconnect () |
virtual void | cleanup () |
virtual void | getStatistics (long int &totalIn, long int &totalOut) |
int | socket () const |
void | setSocket (int socket) |
virtual int | localPort () const |
virtual const std::string | localInterface () const |
Public Member Functions inherited from ConnectionBase | |
ConnectionBase (ConnectionDataHandler *cdh) | |
virtual | ~ConnectionBase () |
ConnectionState | state () const |
void | registerConnectionDataHandler (ConnectionDataHandler *cdh) |
void | setServer (const std::string &server, int port=-1) |
const std::string & | server () const |
int | port () const |
Additional Inherited Members | |
Protected Attributes inherited from ConnectionBase | |
ConnectionDataHandler * | m_handler |
ConnectionState | m_state |
std::string | m_server |
int | m_port |
This is an implementation of a simple TCP connection.
You should only need to use this class directly if you need access to some special feature, like the raw socket(), or if you need HTTP proxy support (see gloox::ConnectionHTTPProxy for more information).
Definition at line 36 of file connectiontcpclient.h.
ConnectionTCPClient | ( | const LogSink & | logInstance, |
const std::string & | server, | ||
int | port = -1 |
||
) |
Constructs a new ConnectionTCPClient object.
logInstance | The log target. Obtain it from ClientBase::logInstance(). |
server | A server to connect to. |
port | The port to connect to. The default of -1 means that XMPP SRV records will be used to find out about the actual host:port. |
Definition at line 45 of file connectiontcpclient.cpp.
ConnectionTCPClient | ( | ConnectionDataHandler * | cdh, |
const LogSink & | logInstance, | ||
const std::string & | server, | ||
int | port = -1 |
||
) |
Constructs a new ConnectionTCPClient object.
cdh | An ConnectionDataHandler-derived object that will handle incoming data. |
logInstance | The log target. Obtain it from ClientBase::logInstance(). |
server | A server to connect to. |
port | The port to connect to. The default of -1 means that SRV records will be used to find out about the actual host:port. |
Definition at line 51 of file connectiontcpclient.cpp.
|
virtual |
Virtual destructor
Definition at line 58 of file connectiontcpclient.cpp.
|
virtual |
Used to initiate the connection.
Implements ConnectionBase.
Definition at line 67 of file connectiontcpclient.cpp.
|
virtual |
This function returns a new instance of the current ConnectionBase-derived object. The idea is to be able to 'clone' ConnectionBase-derived objects without knowing of what type they are exactly.
Implements ConnectionBase.
Definition at line 62 of file connectiontcpclient.cpp.
|
virtual |
Use this periodically to receive data from the socket.
timeout | The timeout to use for select in microseconds. Default of -1 means blocking. |
Implements ConnectionBase.
Definition at line 125 of file connectiontcpclient.cpp.