#include <connection.h>
Collaboration diagram for Connection:
Public Member Functions | |
Connection (Parser *parser, const std::string &server, int port=-1) | |
virtual | ~Connection () |
ConnectionState | connect () |
ConnectionError | recv (int timeout=-1) |
void | send (const std::string &data) |
ConnectionError | receive () |
void | disconnect (ConnectionError e) |
bool | isSecure () const |
ConnectionState | state () const |
int | fileDescriptor () |
void | setCompression (bool compression) |
bool | initCompression (bool init) |
bool | tlsHandshake () |
void | setCACerts (const StringList &cacerts) |
const CertInfo & | fetchTLSInfo () const |
Definition at line 54 of file connection.h.
|
Constructs a new Connection object. You should not need to use this function directly.
Definition at line 45 of file connection.cpp. |
|
Virtual destructor Definition at line 54 of file connection.cpp. References Connection::initCompression(). |
|
Used to initiate the connection.
Definition at line 560 of file connection.cpp. References DNS::connect(), DNS::DNS_COULD_NOT_CONNECT, DNS::DNS_COULD_NOT_RESOLVE, DNS::DNS_NO_HOSTS_FOUND, gloox::STATE_CONNECTED, and gloox::STATE_CONNECTING. Referenced by ClientBase::connect(). |
|
Disconnects an established connection. NOOP if no active connection exists.
Definition at line 384 of file connection.cpp. Referenced by ClientBase::disconnect(). |
|
This function is used to retrieve certificate and connection info of a encrypted connection.
Definition at line 161 of file connection.h. |
|
Gives access to the raw file descriptor of a connection. Use it wisely. Especially, you should not recv() any data from it. There is no way to feed that back into the parser. You can select()/poll() it and use Connection::recv( -1 ) to fetch the data.
Definition at line 393 of file connection.cpp. Referenced by ClientBase::fileDescriptor(). |
|
In case Zlib is available, this function is used to init or de-init stream compression. You must call this before enabling compression using setCompression().
Definition at line 302 of file connection.cpp. Referenced by Connection::~Connection(). |
|
Use this function to determine whether an esatblished connection is encrypted.
Definition at line 109 of file connection.h. Referenced by ClientBase::log(). |
|
Use this function to put the connection into 'receive mode'.
Definition at line 494 of file connection.cpp. References gloox::CONN_IO_ERROR, gloox::CONN_OK, and Connection::recv(). Referenced by ClientBase::connect(). |
|
Use this periodically to receive data from the socket and to feed the parser.
Definition at line 399 of file connection.cpp. References gloox::CONN_IO_ERROR, gloox::CONN_OK, gloox::CONN_USER_DISCONNECTED, Parser::feed(), Parser::PARSER_BADXML, Parser::PARSER_NOMEM, and Parser::PARSER_OK. Referenced by Connection::receive(), and ClientBase::recv(). |
|
Use this function to send a string of data over the wire. The function returns only after all data has been sent.
Definition at line 509 of file connection.cpp. |
|
Use this function to set a number of trusted root CA certificates. which shall be used to verify a servers certificate.
Definition at line 155 of file connection.h. Referenced by ClientBase::connect(). |
|
In case Zlib is available, this function can be used to enable stream compression as defined in JEP-0138.
Definition at line 328 of file connection.cpp. |
|
Returns the current connection state.
Definition at line 115 of file connection.h. Referenced by ClientBase::state(). |
|
Call this function to start a TLS handshake over an established connection. Definition at line 130 of file connection.cpp. References gloox::CERT_INVALID, gloox::CERT_REVOKED, gloox::CERT_SIGNER_NOT_CA, gloox::CERT_SIGNER_UNKNOWN, and CertInfo::status. |