Files
qt5-legatus-legacy/Lts/Tools/DateTimeSyncer/system_caller.h
T
2026-08-13 18:33:10 +02:00

47 lines
741 B
C++
Executable File

/**
* SystemCaller to set Time and Date
* $Id$
* $HeadURL$
* $Author$
* Created by Patric Karwat, NLE, 07-03-2019
*/
#pragma once
#include <QObject>
#include <QString>
#include <QTcpSocket>
#include <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