이 페이지에서

QGrpcMessageReceivedInterceptor Class

RPC에 대한 수신 메시지 페이로드를 가로챕니다. 더 보기...

헤더: #include <QGrpcInterceptor>
CMake: find_package(Qt6 REQUIRED COMPONENTS Grpc)
target_link_libraries(mytarget PRIVATE Qt6::Grpc)
다음부터: Qt 6.11

참고: 이 클래스의 모든 함수는 재진입 가능합니다.

공개 함수

virtual ~QGrpcMessageReceivedInterceptor()
virtual void onMessageReceived(QGrpcInterceptionContext &context, QByteArray &messageData) = 0

상세 설명

RPC에서 수신된 메시지의 직렬화된 메시지 페이로드를 관찰하거나 수정하려면 QGrpcMessageReceivedInterceptor를 구현하십시오.

인터셉션 메커니즘에 대한 소개와 인터셉터 인터페이스가 RPC의 수명 주기에 어떻게 참여하는지에 대한 내용은 Qt GRPC 인터셉터 개요를 참조하십시오.

참고: 이 인터셉터는 아웃바운드 방향에서 작동합니다. 여러 인터셉터 콜백이 체인을 통해 흐르는 방식에 대한 자세한 내용은 ‘방향 및 흐름’ 섹션을 참조하십시오.

또한 QtGrpc::InterceptorCapability::MessageReceived 및 QGrpcInterceptionContext 을참조하십시오 .

멤버 함수 문서

[virtual noexcept] QGrpcMessageReceivedInterceptor::~QGrpcMessageReceivedInterceptor()

요격기를 파괴한다.

[pure virtual] void QGrpcMessageReceivedInterceptor::onMessageReceived(QGrpcInterceptionContext &context, QByteArray &messageData)

수신 메시지 페이로드 messageData 가 사용 가능해지면 호출됩니다.

context 는 가로채진 RPC에 대한 정보를 제공합니다. messageData 에는 직렬화된 메시지 바이트가 포함되어 있으며, 해당 위치에서 직접 수정할 수 있습니다.

QGrpcServerStream::messageReceived() 및 QGrpcBidiStream::messageReceived()도 참조하십시오 .

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