Initialize gRPC on ServerCredentials

pull/25240/head
Yash Tibrewal 4 years ago
parent 1dc357a2b1
commit 0ca1774d0f
  1. 5
      include/grpcpp/security/server_credentials.h
  2. 5
      src/cpp/server/server_credentials.cc

@ -67,9 +67,10 @@ std::shared_ptr<ServerCredentials> XdsServerCredentials(
} // namespace experimental
/// Wrapper around \a grpc_server_credentials, a way to authenticate a server.
class ServerCredentials {
class ServerCredentials : private grpc::GrpcLibraryCodegen {
public:
virtual ~ServerCredentials();
ServerCredentials();
~ServerCredentials() override;
/// This method is not thread-safe and has to be called before the server is
/// started. The last call to this function wins.

@ -18,8 +18,13 @@
#include <grpcpp/security/server_credentials.h>
#include <grpcpp/impl/grpc_library.h>
namespace grpc {
static internal::GrpcLibraryInitializer g_gli_initializer;
ServerCredentials::ServerCredentials() { g_gli_initializer.summon(); }
ServerCredentials::~ServerCredentials() {}
} // namespace grpc

Loading…
Cancel
Save