QModbusTcpConnectionObserver Class
La clase `QModbusTcpConnectionObserver` representa la interfaz para los objetos que se pueden pasar a ` QModbusTcpServer::installConnectionObserver`. Más información...
| Encabezado: | #include <QModbusTcpConnectionObserver> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS SerialBus) target_link_libraries(mytarget PRIVATE Qt6::SerialBus) |
| qmake: | QT += serialbus |
Funciones públicas
| virtual bool | acceptNewConnection(QTcpSocket *newClient) = 0 |
Descripción detallada
El desarrollador debe implementar la interfaz para poder supervisar todas las conexiones TCP entrantes procedentes de otro cliente Modbus.
Véase también QModbusTcpServer::installConnectionObserver.
Documentación de las funciones de miembro
[pure virtual] bool QModbusTcpConnectionObserver::acceptNewConnection(QTcpSocket *newClient)
Esta función es una llamada de retorno para cada conexión TCP entrante. El usuario debe proporcionar una función de llamada de retorno ( newClient ) para recibir una notificación cuando se establezca una nueva conexión de cliente y para determinar si se debe aceptar dicha conexión.
La función debe devolver true si se va a aceptar la conexión. De lo contrario, el socket se cierra o se rechaza.
© 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.