2017-03-29 10:18:37 +00:00
|
|
|
#ifndef WEBSERVERTHREAD_H
|
|
|
|
#define WEBSERVERTHREAD_H
|
|
|
|
|
|
|
|
#include <QThread>
|
2017-04-01 01:50:14 +00:00
|
|
|
#include <QMutex>
|
|
|
|
|
|
|
|
class QRCore;
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
class WebServerThread : public QThread
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
|
2017-04-01 01:50:14 +00:00
|
|
|
explicit WebServerThread(QRCore *core, QObject *parent = 0);
|
|
|
|
~WebServerThread();
|
|
|
|
|
|
|
|
void startServer();
|
|
|
|
void stopServer();
|
|
|
|
|
|
|
|
bool isStarted() const;
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void run();
|
2017-04-01 01:50:14 +00:00
|
|
|
using QThread::start;
|
|
|
|
|
|
|
|
void toggleWebServer();
|
|
|
|
|
|
|
|
mutable QMutex mutex;
|
|
|
|
QRCore *core;
|
|
|
|
bool started;
|
2017-03-29 10:18:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WEBSERVERTHREAD_H
|