parent
6ddbf115e9
commit
b9764cc68f
@ -0,0 +1,19 @@
|
|||||||
|
#include "tcpserver.h"
|
||||||
|
#include "devicesocket.h"
|
||||||
|
|
||||||
|
TcpServer::TcpServer(QObject *parent) : QTcpServer(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
TcpServer::~TcpServer()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TcpServer::incomingConnection(qintptr handle)
|
||||||
|
{
|
||||||
|
DeviceSocket *socket = new DeviceSocket();
|
||||||
|
socket->setSocketDescriptor(handle);
|
||||||
|
addPendingConnection(socket);
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
#ifndef TCPSERVER_H
|
||||||
|
#define TCPSERVER_H
|
||||||
|
|
||||||
|
#include <QTcpServer>
|
||||||
|
|
||||||
|
class TcpServer : public QTcpServer
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit TcpServer(QObject *parent = nullptr);
|
||||||
|
virtual ~TcpServer();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void incomingConnection(qintptr handle);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TCPSERVER_H
|
||||||
Loading…
Reference in new issue