Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+43
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QTcpServer>
|
||||
|
||||
class QTimer;
|
||||
class PayloadSender : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PayloadSender(int numByte, int ctrFail, QTcpSocket *s, QObject *parent = nullptr);
|
||||
~PayloadSender();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onTimeout();
|
||||
private:
|
||||
QTcpSocket *m_socket;
|
||||
QTimer *m_timer;
|
||||
char m_char;
|
||||
int m_numByte;
|
||||
int m_ctrFail;
|
||||
};
|
||||
|
||||
class TcpTestServer : public QTcpServer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TcpTestServer(int numByte, int ctrFail, QObject *parent = nullptr);
|
||||
~TcpTestServer();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onNewIncomingConnection();
|
||||
void onPayloadSenderDestroyed(QObject *obj);
|
||||
private:
|
||||
QSet<QObject *> m_openConnections;
|
||||
int m_numByte;
|
||||
int m_ctrFail;
|
||||
};
|
||||
Reference in new issue
Block a user