QModbusTcpConnectionObserver Class

QModbusTcpConnectionObserver 클래스는 QModbusTcpServer::installConnectionObserver 에 전달할 수 있는 객체에 대한 인터페이스를 나타냅니다. 더 보기...

Header: #include <QModbusTcpConnectionObserver>
CMake: find_package(Qt6 REQUIRED COMPONENTS SerialBus)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)
qmake: QT += serialbus

공용 함수

virtual bool acceptNewConnection(QTcpSocket *newClient) = 0

상세 설명

다른 모드버스 클라이언트로부터 들어오는 모든 TCP 연결을 모니터링하려면 개발자가 이 인터페이스를 구현해야 합니다.

QModbusTcpServer::installConnectionObserver참조하세요 .

멤버 함수 문서

[pure virtual] bool QModbusTcpConnectionObserver::acceptNewConnection(QTcpSocket *newClient)

이 함수는 들어오는 모든 TCP 연결에 대한 콜백입니다. 사용자는 새 클라이언트 연결이 설정될 때 알림을 받고 연결을 수락할지 여부를 결정하기 위해 newClient 을 제공해야 합니다.

연결이 수락되면 이 함수는 true 을 반환해야 합니다. 그렇지 않으면 소켓이 닫히거나 거부됩니다.

© 2025 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.