The way of obtaining IPv6 is changed.

This commit is contained in:
Denis Davydov 2018-06-22 15:07:53 +03:00
parent fd20de0e38
commit aac8567528
2 changed files with 5 additions and 1 deletions

View File

@ -12,7 +12,7 @@ void Handler::handle(QJsonObject jsonReceived)
QJsonObject jsonSend; QJsonObject jsonSend;
if(jsonReceived["action"] == "createSession" && !jsonReceived.contains("status")) if(jsonReceived["action"] == "createSession" && !jsonReceived.contains("status"))
{ {
jsonSend["peerID"] = QHostAddress("fc8f:cc50:70b0:3731:d686:a75e:94f2:f44f").toString(); jsonSend["peerID"] = my_ipv6;
jsonSend["action"] = "createSession"; jsonSend["action"] = "createSession";
jsonSend["status"] = true; jsonSend["status"] = true;
QString peerReceiver = jsonReceived["peerID"].toString(); QString peerReceiver = jsonReceived["peerID"].toString();

View File

@ -7,6 +7,8 @@ class Handler : public QObject
{ {
Q_OBJECT Q_OBJECT
const QString my_ipv6 = Network::local_ipv6();
public: public:
Handler(); Handler();
signals: signals:
@ -15,4 +17,6 @@ class Handler : public QObject
Network *network; Network *network;
private slots: private slots:
void handle(QJsonObject jsonReceived); void handle(QJsonObject jsonReceived);
}; };