From 4f5e71e25599c10f439f92b825ff0a247ed8ba7b Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Sun, 18 Jul 2010 10:37:31 +0000 Subject: rework QXmppStun API to make it more socket-like --- source/QXmppStun.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source/QXmppStun.cpp') diff --git a/source/QXmppStun.cpp b/source/QXmppStun.cpp index 00e3d2e3..8594a53f 100644 --- a/source/QXmppStun.cpp +++ b/source/QXmppStun.cpp @@ -603,12 +603,11 @@ void QXmppStunSocket::connectToHost() m_timer->start(); } -/// Returns the QIODevice::OpenMode which represents the socket's ability -/// to read and/or write data. +/// Returns true if ICE negotiation completed, false otherwise. -QIODevice::OpenMode QXmppStunSocket::openMode() const +bool QXmppStunSocket::isConnected() const { - return m_activePair ? QIODevice::ReadWrite : QIODevice::NotOpen; + return m_activePair != 0; } void QXmppStunSocket::debug(const QString &message, QXmppLogger::MessageType type) @@ -735,7 +734,7 @@ void QXmppStunSocket::readyRead() quint16 messageType = QXmppStunMessage::peekType(buffer); if (!messageType) { - emit datagramReceived(buffer, remoteHost, remotePort); + emit datagramReceived(buffer); return; } @@ -838,7 +837,7 @@ void QXmppStunSocket::readyRead() debug(QString("ICE completed %1").arg(pair->toString())); m_activePair = pair; m_timer->stop(); - emit ready(); + emit connected(); } } -- cgit v1.2.3