@@ -162,32 +162,47 @@ class GrpcServer {
162162
163163 // / Name of this server, used for logging and debugging purpose.
164164 const std::string name_;
165+
165166 // / Port of this server.
166167 int port_;
168+
167169 // / Listen to localhost (127.0.0.1) only if it's true, otherwise listen to all network
168170 // / interfaces (0.0.0.0)
169171 const bool listen_to_localhost_only_;
172+
170173 // / Token representing ID of this cluster.
171174 ClusterID cluster_id_;
175+
172176 // / Authentication token for token-based authentication.
173177 std::optional<AuthenticationToken> auth_token_;
178+
174179 // / Indicates whether this server is in shutdown state.
175180 std::atomic<bool > is_shutdown_;
181+
176182 // / The `grpc::Service` objects which should be registered to `ServerBuilder`.
177183 std::vector<std::unique_ptr<grpc::Service>> grpc_services_;
184+
178185 // / The `GrpcService`(defined below) objects which contain grpc::Service objects not in
179186 // / the above vector.
180187 std::vector<std::unique_ptr<GrpcService>> services_;
188+
181189 // / The `ServerCallFactory` objects.
182190 std::vector<std::unique_ptr<ServerCallFactory>> server_call_factories_;
183- // / The number of completion queues the server is polling from.
191+
192+ // / The number of threads and completion queues the server is polling from for incoming
193+ // / requests. These threads are also responsible for creating the proto request objects.
184194 int num_threads_;
195+
185196 // / The `ServerCompletionQueue` object used for polling events.
186197 std::vector<std::unique_ptr<grpc::ServerCompletionQueue>> cqs_;
198+
187199 // / The `Server` object.
188200 std::unique_ptr<grpc::Server> server_;
189- // / The polling threads used to check the completion queues.
201+
202+ // / The polling threads used to check the completion queues and create the proto request
203+ // / objects.
190204 std::vector<std::thread> polling_threads_;
205+
191206 // / The interval to send a new gRPC keepalive timeout from server -> client.
192207 // / gRPC server cannot get the ping response within the time, it triggers
193208 // / the watchdog timer fired error, which will close the connection.
0 commit comments