QModbusTcpConnectionObserver Class
La classe `QModbusTcpConnectionObserver` rappresenta l'interfaccia per gli oggetti che possono essere passati a ` QModbusTcpServer::installConnectionObserver`. Altro...
| Intestazione: | #include <QModbusTcpConnectionObserver> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS SerialBus) target_link_libraries(mytarget PRIVATE Qt6::SerialBus) |
| qmake: | QT += serialbus |
Funzioni pubbliche
| virtual bool | acceptNewConnection(QTcpSocket *newClient) = 0 |
Descrizione dettagliata
L'interfaccia deve essere implementata dallo sviluppatore per poter monitorare ogni connessione TCP in entrata proveniente da un altro client Modbus.
Vedi anche QModbusTcpServer::installConnectionObserver.
Documentazione delle funzioni membro
[pure virtual] bool QModbusTcpConnectionObserver::acceptNewConnection(QTcpSocket *newClient)
Questa funzione è una callback per ogni connessione TCP in entrata. L'utente deve fornire un'newClient a per ricevere una notifica quando viene stabilita una nuova connessione client e per determinare se la connessione debba essere accettata.
La funzione deve restituire ` true ` se la connessione deve essere accettata. In caso contrario, il socket viene chiuso/rifiutato.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.