This repository is supposed to document an issue that was posted in the gRPC github project.
A DLL provides a singleton of a class that wraps the gRPC service client (using the PIMPL idiom). The executable gets an instance of the singleton (actually nothing happens beyond instantiation of a channel object) and the process blocks indefinitely on shutdown. Although we use a DLL here, the (static) gRPC libs are only linked into this one DLL (so no duplicate static gRPC data). The result seems to be unstable: If the environment variables GRPC_VERBOSITY=debug and GRPC_TRACE=all are set to enable debugging, the process ends without issues.
The project as well as gRCP were built with Visual Studio 2019.
To build gRPC, these were the steps that were used
git clone https://github.com/grpc/grpc
cd grpc
git submodule update --init
The following will install gRPC in the folder c:\temp\grpc
(last parameter in the long config command) which is also used in the cmake file of this repo. Feel free to change it at both locations.
md .build
cd .build
cmake .. -G "Visual Studio 16 2019" -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF -DgRPC_BUILD_CSHARP_EXT=OFF -DABSL_ENABLE_INSTALL=ON -DCMAKE_INSTALL_PREFIX="c:/temp/grpc"
cmake --build . --config Release
cmake --install .
After successful build and install of gRPC as described above, you can build this repository.
- Clone this repository
- Open the folder in Visual Studio 2019
- Generate the cmake cache
- Build
- Run the target InfiniteBlockExample.exe (Install)