diff options
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/mcast/McastPGMSocket.cpp | 8 | ||||
| -rw-r--r-- | src/net/mcast/McastPGMSocket.h | 2 |
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; |
