34 lines
706 B
C++
Executable File
34 lines
706 B
C++
Executable File
#include <QCoreApplication>
|
|
#include <QTcpServer>
|
|
#include <QTcpSocket>
|
|
#include <QDebug>
|
|
#include "egcu_simulator.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QCoreApplication a(argc, argv);
|
|
|
|
int port = 8080;
|
|
|
|
if (argc < 2)
|
|
{
|
|
qDebug() << "Bitte Port als Parameter beim Aufruf mit angeben!";
|
|
qDebug() << "egcuSimulator läuft per Default mit port 8080";
|
|
}
|
|
else
|
|
{
|
|
port = std::stoi(argv[1]);
|
|
qDebug() << "Port=" << port;
|
|
}
|
|
|
|
SimpleWebServer server;
|
|
if (!server.listen(QHostAddress::Any, port))
|
|
{
|
|
qCritical() << "Server konnte nicht gestartet werden:" << server.errorString();
|
|
return 1;
|
|
}
|
|
|
|
qDebug() << "Server läuft auf Port" << port << "...";
|
|
return a.exec();
|
|
}
|