Merge pull request #9629 from yang-g/qqq

Add a PreServerStart in global server callbacks
pull/9643/head
Yang Gao 8 years ago committed by GitHub
commit f0ef22496c
  1. 2
      include/grpc++/server.h
  2. 1
      src/cpp/server/server_cc.cc

@ -88,6 +88,8 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen {
virtual void PreSynchronousRequest(ServerContext* context) = 0;
/// Called after application callback for each synchronous server request
virtual void PostSynchronousRequest(ServerContext* context) = 0;
/// Called before server is started.
virtual void PreServerStart(Server* server) {}
};
/// Set the global callback object. Can only be called once. Does not take
/// ownership of callbacks, and expects the pointed to object to be alive

@ -478,6 +478,7 @@ int Server::AddListeningPort(const grpc::string& addr,
bool Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) {
GPR_ASSERT(!started_);
global_callbacks_->PreServerStart(this);
started_ = true;
grpc_server_start(server_);

Loading…
Cancel
Save