QXmpp  Version:1.0.0
Public Types | Public Slots | Signals | Public Member Functions | Properties | List of all members
QXmppIceConnection Class Reference

The QXmppIceConnection class represents a set of UDP sockets capable of performing Interactive Connectivity Establishment (RFC 5245). More...

#include <QXmppStun.h>

Inheritance diagram for QXmppIceConnection:
Inheritance graph
[legend]
Collaboration diagram for QXmppIceConnection:
Collaboration graph
[legend]

Public Types

enum  GatheringState { NewGatheringState, BusyGatheringState, CompleteGatheringState }
 

Public Slots

void close ()
 Closes the ICE connection.
 
void connectToHost ()
 Starts ICE connectivity checks.
 

Signals

void connected ()
 This signal is emitted once ICE negotiation succeeds.
 
void disconnected ()
 This signal is emitted when ICE negotiation fails.
 
void gatheringStateChanged ()
 This signal is emitted when the gathering state of local candidates changes.
 
void localCandidatesChanged ()
 This signal is emitted when the list of local candidates changes.
 
- Signals inherited from QXmppLoggable
void setGauge (const QString &gauge, double value)
 Sets the given gauge to value.
 
void logMessage (QXmppLogger::MessageType type, const QString &msg)
 This signal is emitted to send logging messages.
 
void updateCounter (const QString &counter, qint64 amount=1)
 Updates the given counter by amount.
 

Public Member Functions

 QXmppIceConnection (QObject *parent=0)
 
QXmppIceComponentcomponent (int component)
 
void addComponent (int component)
 
void setIceControlling (bool controlling)
 
QList< QXmppJingleCandidatelocalCandidates () const
 
QString localUser () const
 Returns the local user fragment.
 
QString localPassword () const
 Returns the local password.
 
void addRemoteCandidate (const QXmppJingleCandidate &candidate)
 
void setRemoteUser (const QString &user)
 
void setRemotePassword (const QString &password)
 
void setStunServer (const QHostAddress &host, quint16 port=3478)
 
void setTurnServer (const QHostAddress &host, quint16 port=3478)
 
void setTurnUser (const QString &user)
 
void setTurnPassword (const QString &password)
 
bool bind (const QList< QHostAddress > &addresses)
 
bool isConnected () const
 Returns true if ICE negotiation completed, false otherwise.
 
GatheringState gatheringState () const
 
- Public Member Functions inherited from QXmppLoggable
 QXmppLoggable (QObject *parent=0)
 

Properties

QXmppIceConnection::GatheringState gatheringState
 

Additional Inherited Members

- Protected Member Functions inherited from QXmppLoggable
void debug (const QString &message)
 
void info (const QString &message)
 
void warning (const QString &message)
 
void logReceived (const QString &message)
 
void logSent (const QString &message)
 

Detailed Description

The QXmppIceConnection class represents a set of UDP sockets capable of performing Interactive Connectivity Establishment (RFC 5245).

A typical example is:

connection->setIceControlling(true);
connection->addComponent(1);
// if needed, set STUN / TURN configuration
// connection->setStunServer(..);
// connection->setTurnServer(..);
// start listening
// receive remote information: user, password, candidates
// ...
// set remote information and start connecting
connection->setRemoteUser("foo");
connection->setRemoteUser("bar");
connection->addRemoteCandidate(..);
connection->connectToHost();

Constructor & Destructor Documentation

◆ QXmppIceConnection()

QXmppIceConnection::QXmppIceConnection ( QObject *  parent = 0)

Constructs a new ICE connection.

Parameters
parent

Member Function Documentation

◆ addComponent()

void QXmppIceConnection::addComponent ( int  component)

Adds a component to this ICE connection, for instance 1 for RTP or 2 for RTCP.

Parameters
component

◆ addRemoteCandidate()

void QXmppIceConnection::addRemoteCandidate ( const QXmppJingleCandidate candidate)

Adds a candidate for one of the remote components.

Parameters
candidate

◆ bind()

bool QXmppIceConnection::bind ( const QList< QHostAddress > &  addresses)

Binds the local sockets to the specified addresses.

Parameters
addressesThe addresses on which to listen.

◆ component()

QXmppIceComponent * QXmppIceConnection::component ( int  component)

Returns the given component of this ICE connection.

Parameters
component

◆ localCandidates()

QList< QXmppJingleCandidate > QXmppIceConnection::localCandidates ( ) const

Returns the list of local HOST CANDIDATES candidates by iterating over the available network interfaces.

◆ setIceControlling()

void QXmppIceConnection::setIceControlling ( bool  controlling)

Sets whether the local party has the ICE controlling role.

note This must be called only once, immediately after creating the connection.

◆ setRemotePassword()

void QXmppIceConnection::setRemotePassword ( const QString &  password)

Sets the remote password.

Parameters
password

◆ setRemoteUser()

void QXmppIceConnection::setRemoteUser ( const QString &  user)

Sets the remote user fragment.

Parameters
user

◆ setStunServer()

void QXmppIceConnection::setStunServer ( const QHostAddress &  host,
quint16  port = 3478 
)

Sets the STUN server to use to determine server-reflexive addresses and ports.

Note
This may only be called prior to calling bind().
Parameters
hostThe address of the STUN server.
portThe port of the STUN server.

◆ setTurnPassword()

void QXmppIceConnection::setTurnPassword ( const QString &  password)

Sets the password used for authentication with the TURN server.

Note
This may only be called prior to calling bind().
Parameters
password

◆ setTurnServer()

void QXmppIceConnection::setTurnServer ( const QHostAddress &  host,
quint16  port = 3478 
)

Sets the TURN server to use to relay packets in double-NAT configurations.

Note
This may only be called prior to calling bind().
Parameters
hostThe address of the TURN server.
portThe port of the TURN server.

◆ setTurnUser()

void QXmppIceConnection::setTurnUser ( const QString &  user)

Sets the user used for authentication with the TURN server.

Note
This may only be called prior to calling bind().
Parameters
user

Property Documentation

◆ gatheringState

QXmppIceConnection::GatheringState QXmppIceConnection::gatheringState
read

Returns the ICE gathering state, that is the discovery of local candidates.


The documentation for this class was generated from the following files: