~mateo-salta/nitroshare/nitroshare

« back to all changes in this revision

Viewing changes to include/discovery/CBasicBroadcaster.h

  • Committer: Nathan Osman
  • Date: 2012-06-29 22:01:55 UTC
  • Revision ID: admin@quickmediasolutions.com-20120629220155-ogwrn9fxxve9wyw1
Moved a TON of the broadcast and discovery code around, creating separate classes for each and partially implementing their use in the first start wizard.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
   You should have received a copy of the GNU General Public License
15
15
   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
16
 
17
 
#ifndef CBASICBROADCASTSERVER_H
18
 
#define CBASICBROADCASTSERVER_H
 
17
#ifndef CBASICBROADCASTER_H
 
18
#define CBASICBROADCASTER_H
19
19
 
 
20
#include <QHostAddress>
 
21
#include <QNetworkInterface>
 
22
#include <QTimer>
20
23
#include <QUdpSocket>
21
24
 
22
 
class CBasicBroadcastServer : public QUdpSocket
 
25
class CBasicBroadcaster : public QUdpSocket
23
26
{
24
27
    Q_OBJECT
25
28
 
26
29
    public:
27
30
 
28
 
        CBasicBroadcastServer();
 
31
        CBasicBroadcaster();
 
32
 
 
33
        void Init();
 
34
        void Init(QNetworkInterface);
 
35
 
 
36
        bool HasAddress(QHostAddress);
29
37
 
30
38
    signals:
31
39
 
32
40
        void Error(QString);
33
41
        void Information(QString);
 
42
 
 
43
    private slots:
 
44
 
 
45
        void OnTimer();
 
46
 
 
47
    private:
 
48
 
 
49
        QTimer m_timer;
 
50
        qint64 m_uptime;
 
51
 
 
52
        QHostAddress m_broadcast_address;
 
53
        QHostAddress m_netmask_address;
34
54
};
35
55
 
36
 
#endif // CBASICBROADCASTSERVER_H
 
56
#endif // CBASICBROADCASTER_H