mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-04-29 22:24:26 +02:00
29 lines
670 B
C++
29 lines
670 B
C++
#include <QtNetwork/qtcpsocket.h>
|
|
#include <QDnsLookup>
|
|
#include <QHostInfo>
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
// resolve the IP and port of a Minecraft server
|
|
class McResolver : public QObject {
|
|
Q_OBJECT
|
|
|
|
QString m_constrDomain;
|
|
int m_constrPort;
|
|
|
|
public:
|
|
explicit McResolver(QObject* parent, QString domain, int port);
|
|
void ping();
|
|
|
|
private:
|
|
void pingWithDomainSRV(QString domain, int port);
|
|
void pingWithDomainA(QString domain, int port);
|
|
void emitFail(QString error);
|
|
void emitSucceed(QString ip, int port);
|
|
|
|
signals:
|
|
void succeeded(QString ip, int port);
|
|
void failed(QString error);
|
|
void finished();
|
|
};
|