summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Braun2010-07-15 16:43:33 +0200
committerSebastien Braun2010-07-15 16:43:33 +0200
commit7683c023be91cfe830178f63bb353d09349abbf7 (patch)
tree5a410f7c9f31c3a63367761565c31e07705bcf87
parentDisable PGMCC as it is buggy (diff)
downloadpvs-7683c023be91cfe830178f63bb353d09349abbf7.tar.gz
pvs-7683c023be91cfe830178f63bb353d09349abbf7.tar.xz
pvs-7683c023be91cfe830178f63bb353d09349abbf7.zip
Add isOpen() test to McastPGMSocket
-rw-r--r--src/net/mcast/McastPGMSocket.cpp8
-rw-r--r--src/net/mcast/McastPGMSocket.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/net/mcast/McastPGMSocket.cpp b/src/net/mcast/McastPGMSocket.cpp
index f2aa91f..105bea9 100644
--- a/src/net/mcast/McastPGMSocket.cpp
+++ b/src/net/mcast/McastPGMSocket.cpp
@@ -86,6 +86,7 @@ static void _ensurePGMInited()
McastPGMSocket::McastPGMSocket(QObject* parent) :
QObject(parent),
_priv(new McastPGMSocket_priv),
+ _opened(false),
_finished(false),
_nakTimeout(new QTimer()),
_dataTimeout(new QTimer()),
@@ -279,6 +280,8 @@ bool McastPGMSocket::open(McastConfiguration const* config, Direction direction)
return false;
}
+ _opened = true;
+
setupNotifiers();
pgm_freeaddrinfo(addrinfo);
@@ -594,6 +597,11 @@ bool McastPGMSocket::finished() const
return _finished;
}
+bool McastPGMSocket::isOpen() const
+{
+ return _opened && !_finished;
+}
+
void McastPGMSocket::shutdown(int interval)
{
if(_priv->direction == PSOCK_READ)
diff --git a/src/net/mcast/McastPGMSocket.h b/src/net/mcast/McastPGMSocket.h
index ad42aa5..4ccf931 100644
--- a/src/net/mcast/McastPGMSocket.h
+++ b/src/net/mcast/McastPGMSocket.h
@@ -41,6 +41,7 @@ public:
bool open(McastConfiguration const* config, Direction direction);
bool finished() const;
+ bool isOpen() const;
void shutdown(int interval = DEFAULT_MULTICAST_SHUTDOWN_TIMEOUT);
signals:
@@ -67,6 +68,7 @@ private:
McastPGMSocket_priv* _priv;
QQueue<QByteArray> _q;
bool _finished;
+ bool _opened;
QTimer* _nakTimeout;
QTimer* _dataTimeout;
QTimer* _sendTimeout;