qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
bootstrapnodeupdater.h
Go to the documentation of this file.
1 /*
2  Copyright © 2018-2020 by The qTox Project Contributors
3 
4  This file is part of qTox, a Qt-based graphical interface for Tox.
5 
6  qTox is libre software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  qTox is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with qTox. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include <QList>
23 #include <QNetworkAccessManager>
24 #include <QNetworkProxy>
25 #include <QObject>
26 
27 #include "src/core/dhtserver.h"
29 
30 class QNetworkReply;
31 class Paths;
32 
33 class BootstrapNodeUpdater : public QObject, public IBootstrapListGenerator
34 {
35  Q_OBJECT
36 public:
37  explicit BootstrapNodeUpdater(const QNetworkProxy& proxy, Paths& _paths, QObject* parent = nullptr);
38  QList<DhtServer> getBootstrapnodes() const override;
39  void requestBootstrapNodes();
41 
42 signals:
44 
45 private slots:
46  void onRequestComplete(QNetworkReply* reply);
47 
48 private:
50 
51 private:
52  QNetworkProxy proxy;
53  QNetworkAccessManager nam;
55 };
dhtserver.h
BootstrapNodeUpdater::onRequestComplete
void onRequestComplete(QNetworkReply *reply)
Definition: bootstrapnodeupdater.cpp:255
IBootstrapListGenerator
Definition: ibootstraplistgenerator.h:25
Paths
Definition: paths.h:28
BootstrapNodeUpdater::proxy
QNetworkProxy proxy
Definition: bootstrapnodeupdater.h:52
BootstrapNodeUpdater::availableBootstrapNodes
void availableBootstrapNodes(QList< DhtServer > nodes)
QList
Definition: friendlist.h:25
BootstrapNodeUpdater::getBootstrapnodes
QList< DhtServer > getBootstrapnodes() const override
Definition: bootstrapnodeupdater.cpp:216
BootstrapNodeUpdater::paths
Paths & paths
Definition: bootstrapnodeupdater.h:54
BootstrapNodeUpdater::loadDefaultBootstrapNodes
static QList< DhtServer > loadDefaultBootstrapNodes()
Loads the list of built in boostrap nodes.
Definition: bootstrapnodeupdater.cpp:250
BootstrapNodeUpdater::requestBootstrapNodes
void requestBootstrapNodes()
Definition: bootstrapnodeupdater.cpp:235
BootstrapNodeUpdater::nam
QNetworkAccessManager nam
Definition: bootstrapnodeupdater.h:53
BootstrapNodeUpdater::BootstrapNodeUpdater
BootstrapNodeUpdater(const QNetworkProxy &proxy, Paths &_paths, QObject *parent=nullptr)
Fetches a list of currently online bootstrap nodes from node.tox.chat.
Definition: bootstrapnodeupdater.cpp:210
BootstrapNodeUpdater::loadUserBootrapNodes
QList< DhtServer > loadUserBootrapNodes()
ibootstraplistgenerator.h
BootstrapNodeUpdater
Definition: bootstrapnodeupdater.h:33