.hpp -> .h
This commit is contained in:
27
launcher/ui/pages/instance/McResolver.h
Normal file
27
launcher/ui/pages/instance/McResolver.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QDnsLookup>
|
||||
#include <QtNetwork/qtcpsocket.h>
|
||||
#include <QHostInfo>
|
||||
|
||||
// resolve the IP and port of a Minecraft server
|
||||
class McResolver : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
QString constrDomain;
|
||||
int 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(std::string error);
|
||||
void emitSucceed(QString ip, int port);
|
||||
|
||||
signals:
|
||||
void succeed(QString ip, int port);
|
||||
void fail();
|
||||
};
|
||||
Reference in New Issue
Block a user