diff options
Diffstat (limited to 'src/serialbus/qmodbustcpserver.h')
-rw-r--r-- | src/serialbus/qmodbustcpserver.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/serialbus/qmodbustcpserver.h b/src/serialbus/qmodbustcpserver.h index 57276a5..cf24d42 100644 --- a/src/serialbus/qmodbustcpserver.h +++ b/src/serialbus/qmodbustcpserver.h @@ -43,6 +43,15 @@ QT_BEGIN_NAMESPACE class QModbusTcpServerPrivate; +class QTcpSocket; + +class Q_SERIALBUS_EXPORT QModbusTcpConnectionObserver +{ +public: + virtual ~QModbusTcpConnectionObserver(); + + virtual bool acceptNewConnection(QTcpSocket *newClient) = 0; +}; class Q_SERIALBUS_EXPORT QModbusTcpServer : public QModbusServer { @@ -53,6 +62,11 @@ public: explicit QModbusTcpServer(QObject *parent = nullptr); ~QModbusTcpServer(); + void installConnectionObserver(QModbusTcpConnectionObserver *observer); + +Q_SIGNALS: + void modbusClientDisconnected(QTcpSocket *modbusClient); + protected: QModbusTcpServer(QModbusTcpServerPrivate &dd, QObject *parent = nullptr); |