このページでは

QModbusTcpConnectionObserver Class

QModbusTcpConnectionObserver クラスは、QModbusTcpServer::installConnectionObserver に渡すことができるオブジェクトのインターフェースを表します。詳細...

ヘッダー: #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

詳細な説明

他の Modbus クライアントからのすべての着信 TCP 接続を監視できるようにするには、開発者がこのインターフェースを実装する必要があります。

QModbusTcpServer::installConnectionObserverも参照してください 。

メンバ関数のドキュメント

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

この関数は、着信するすべてのTCP接続に対するコールバックです。ユーザーは、新しいクライアント接続が確立された際に通知を受け取り、その接続を受け入れるかどうかを判断するために、newClient を指定する必要があります。

接続を受け入れる場合は、この関数は `true ` を返す必要があります。そうでない場合は、ソケットは閉じられるか、接続が拒否されます。

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