-
Notifications
You must be signed in to change notification settings - Fork 73
Reflection information is only published for a single service #452
Description
The current gRPC server LabVIEW generator code creates an array of reflection descriptor strings which is passed to the server DLL to publish via the gRPC reflection service. Each element of this array represents a generated reflection string for each proto file parsed (so if one generates a gRPC server from 3 proto files, this array would contain 3 elements; one for each proto file used).
In the LabVIEW code, we iterate over this array and send each element down to the DLL separately:

However, in the DLL, we constantly are replacing the descriptor string with the next element:
grpc-labview/src/lv_proto_server_reflection_plugin.cc
Lines 66 to 70 in 579e3d2
| LIBRARY_EXPORT void DeserializeReflectionInfo(grpc_labview::LStrHandle serializedFileDescriptor) | |
| { | |
| std::string serializedDescriptorStr = grpc_labview::GetLVString(serializedFileDescriptor); | |
| grpc_labview::ProtoDescriptorString::getInstance()->setDescriptor(serializedDescriptorStr); | |
| } |
As a result, only the last service's reflection descriptor string to be sent to the DLL is used and only that service is published via gRPC reflection.
Either the DLL should be able to capture and accumulate these descriptor strings for multiple services -- or the LabVIEW code should concatenate them together (note that I'm not sure if that's the appropriate operation) and pass a single string which represents all registered services at once just before calling Start Server.vi