Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Tools/DateTimeSyncer/system_caller.h
T

47 lines
762 B
C++
Executable File

/**
* SystemCaller to set Time and Date
* $Id$
* $HeadURL$
* $Author$
* Created by Patric Karwat, NLE, 07-03-2019
*/
#pragma once
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QTcpSocket>
#include <QtCore/QThread>
#include "tcp_server.h"
#include "logger.h"
namespace DateTimeSyncer
{
class SystemCaller : public QObject
{
Q_OBJECT
public:
explicit SystemCaller(QObject *parent = nullptr);
~SystemCaller();
bool init(int tcpPort);
private slots:
// tcp
void newConnection();
void readTcp();
void tcpDisconnected();
void handleTcpError(QAbstractSocket::SocketError error);
private:
TcpServer *m_tcpServer;
QVector<QTcpSocket *> m_sockets;
LOGGER_T m_logger;
};
} //namespace DateTimeSyncer