After spending 2 non fruitful days trying to resolve a conflict between my gRPC generated files needing “libprotobuf”.lib" and UE4.27 webRTC already defining libprotobuf.lib, I decided to migrate to UE5 after some Discord suggestions.
Indeed I can see within UE5 ThirtParty folders that Protobuf has been excluded in its own folder now, as well as gRPC seems to be existing as well here: “\UE_5.0\Engine\Source\ThirdParty\vcpkg”.
Tried installing it as vcpkg instructs, but that vcpkg folder does not include bootstrap bat file, therefore I’m still quite confused on how I could generate my gRPC files from within UE5.
I think I found the problem now when looking closer. The hint being your statement “Currently, the async node cannot support gRPC functions of client stream and server stream types.” clearly indicating that if I only have a stream service, there will be no node
So I guess the bug then is, that if you only have a stream service, no node .h and .cpp files should be generated at all, as the #includes would cause problems when they include a non-existing LiveStreamNode.generated.h
I’ve been trying to use your plugin with Unreal, and everything in your instructions worked, but when I generated the code, the *Node.h and *Node.cpp files ended up being empty except for the #include statements. The build fails because there is no .generated.h file for the Node. The other files, such as the Service. and the output from protoc.exe looks to be fine…
Writing to you here first before posting a bug at github to see if you have any idea what it could be about? I don’t see anything sticking out in my proto file really. When generating code for your Greeter example in the same plugin installation I created, the code seem to generate normally.
Hi @JinChao, it seems that error handling is totally ignored
if (!Ok)
{
Super::RpcReaderWriter->Finish(&(Super::RpcStatus), Super::ReadTag);
Super::UpdateState(EGrpcContextState::Done);
return;
}
I don’t receive any reply, for example i don’t send the authorization bearer inside the header, instead I would expect to get an error message (16 UNAUTHENTICATED).
I have found a solution starting from GrpcWrapper, the plugin offers only a module where you can write grpc code (import the library), TurboLink is more powerfull. I used the method async() with ClientReadReactor like this example.
To handle the events i have used AsyncTask
finally, I solved Turbolink error handling by slightly modifiying OnRpcEventInternal in the relevant GrpcContext. we need to wait Finish call async processing with proper status (after another AsyncNext in the Manager).
implement FinishTag to Super::RpcReaderWriter->Finish call
after this call don’t UpdateState to Done.
but after GrpcContext::MakeGrpcResult filter FinishTag and update state here.
if (!Ok)
{
Super::RpcReaderWriter->Finish(&(Super::RpcStatus), Super::FinishTag);
// Don't Update State to Done here, because need to wait when this operation finished on the next AsyncNext which updates Super::RpcStatus
// Super::UpdateState(EGrpcContextState::Done);
return;
}
FGrpcResult result = GrpcContext::MakeGrpcResult(Super::RpcStatus);
// Finish operation processed - handle error if exists and Update State to Done
if (EventTag == Super::FinishTag)
{
if (RpcCallbackFunc && !Super::RpcStatus.ok())
{
UE_LOG(LogTurboLink, Error, TEXT("CallRpcError: %s"), *result.GetMessageString());
if (RpcCallbackFunc)
{
RpcCallbackFunc(result, nullptr);
}
}
Super::UpdateState(EGrpcContextState::Done);
return;
}