Skip to content
Snippets Groups Projects
Commit c5fc2b71 authored by Yang Gao's avatar Yang Gao Committed by GitHub
Browse files

Merge pull request #10663 from yang-g/globalcallback

Update ServerGlobalCallback::AddPort api
parents 3ddc13b2 eafeea48
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,8 @@ class Server final : public ServerInterface, private GrpcLibraryCodegen {
/// Called before server is started.
virtual void PreServerStart(Server* server) {}
/// Called after a server port is added.
virtual void AddPort(Server* server, int port) {}
virtual void AddPort(Server* server, const grpc::string& addr,
ServerCredentials* creds, int port) {}
};
/// 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
......
......@@ -503,7 +503,7 @@ int Server::AddListeningPort(const grpc::string& addr,
ServerCredentials* creds) {
GPR_ASSERT(!started_);
int port = creds->AddPortToServer(addr, server_);
global_callbacks_->AddPort(this, port);
global_callbacks_->AddPort(this, addr, creds, port);
return port;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment