create interface

This commit is contained in:
2023-11-29 11:53:20 +01:00
parent e8cb3ab9b9
commit 847393cec3
9 changed files with 148 additions and 1 deletions

View File

@@ -1,7 +1,30 @@
#include <QApplication>
#include <QSslSocket>
#include "stompframe.h"
int main(int argc, char *argv[]) {
QApplication application(argc, argv);
QSslSocket socket;
socket.setPeerVerifyMode(QSslSocket::VerifyNone);
QObject::connect(&socket, &QSslSocket::readyRead, [&]() {
auto frame = STOMPFrame::receive(socket);
qDebug() << "Connected:" << (frame.command() == STOMPFrame::CONNECTED) << Qt::endl
<< "Version:" << frame.headers().value("version");
});
socket.connectToHostEncrypted("sdi.hevs.ch", 61614);
if(!socket.waitForConnected()) return -1;
STOMPFrame(STOMPFrame::STOMP, {
{"accept-version", "1.2"},
{"host", "/"},
{"login", "sdi10"},
{"passcode", "809c02f36becb0868da98761fe3209f6"}
}).send(socket);
return application.exec();
}