Is there any library to achieve data sending between ue program and non-ue program?

We target Windows and Linux currently (and Mac too at some point). Our libprotobuf port is in our Tasmania plugin, feel free to use it if you’re having trouble integrating protobuf:

We don’t use gRPC - just serialize the request and response to a HTTP POST request. We do actually use the protobuf service syntax in the .proto, but then generate an unreal C++ class from the reflection of the service definition with an in-house python script. But you shouldn’t need that unless you have a lot of different RPC messages, you can just write the code for each RPC manually to begin with.

To send a message you call:

  1. .SerializeToString on the protobuf request message.
  2. Then:
TSharedRef<IHttpRequest> HttpRequest = FHttpModule::Get().CreateRequest();
HttpRequest->SetVerb("POST");
HttpRequest->SetHeader("Content-Type", "application/protobuf");
HttpRequest->SetURL("http://yourservice.url/yourmethod");
HttpRequest->SetContent(TheSerializedProtobufString);

In the response handler you deserialize the response protobuf by calling GetContent on the FHttpRequestPtr to get the byte array, and then calling .ParseFromArray on the response protobuf message.

Let me know if you have any questions.

2 Likes