QXmppIceComponent Class

The QXmppIceComponent class represents a piece of a media stream requiring a single transport address, as defined by RFC 5245 (Interactive Connectivity Establishment). More...

Header: #include <QXmppStun.h>
Inherits: QXmppLoggable

Public Functions

virtual ~QXmppIceComponent() override
int component() const
bool isConnected() const
QList<QXmppJingleCandidate> localCandidates() const

Public Slots

void close()
void connectToHost()
qint64 sendDatagram(const QByteArray &datagram)

Signals

void connected()
void datagramReceived(const QByteArray &datagram)
void gatheringStateChanged()
void localCandidatesChanged()

Static Public Members

QList<QHostAddress> discoverAddresses()
QList<QUdpSocket *> reservePorts(const QList<QHostAddress> &addresses, int count, QObject *parent = nullptr)

Detailed Description

Member Function Documentation

[override virtual noexcept] QXmppIceComponent::~QXmppIceComponent()

Destroys the QXmppIceComponent.

[slot] void QXmppIceComponent::close()

Stops ICE connectivity checks and closes the underlying sockets.

int QXmppIceComponent::component() const

Returns the component id for the current socket, e.g. 1 for RTP and 2 for RTCP.

[slot] void QXmppIceComponent::connectToHost()

Starts ICE connectivity checks.

[signal] void QXmppIceComponent::connected()

This signal is emitted once ICE negotiation succeeds.

[signal] void QXmppIceComponent::datagramReceived(const QByteArray &datagram)

This signal is emitted when a data packet is received.

datagram.

[static] QList<QHostAddress> QXmppIceComponent::discoverAddresses()

Returns the list of local network addresses.

[signal] void QXmppIceComponent::gatheringStateChanged()

This signal is emitted when the gathering state of local candidates changes.

bool QXmppIceComponent::isConnected() const

Returns true if ICE negotiation completed, false otherwise.

QList<QXmppJingleCandidate> QXmppIceComponent::localCandidates() const

Returns the list of local candidates.

[signal] void QXmppIceComponent::localCandidatesChanged()

This signal is emitted when the list of local candidates changes.

[static] QList<QUdpSocket *> QXmppIceComponent::reservePorts(const QList<QHostAddress> &addresses, int count, QObject *parent = nullptr)

Tries to bind count UDP sockets on each of the given addresses.

The port numbers are chosen so that they are consecutive, starting at an even port. This makes them suitable for RTP/RTCP sockets pairs.

addresses is the network address on which to bind the sockets. count is the number of ports to reserve. parent is the parent object for the sockets.

[slot] qint64 QXmppIceComponent::sendDatagram(const QByteArray &datagram)

Sends a datagram to the remote party.