class Server
Defined at line 57 of file ../../third_party/grpc-migrating/src/include/grpcpp/server.h
Represents a gRPC server.
Use a
to create, configure, and start
instances.
Public Methods
HealthCheckServiceInterface * GetHealthCheckService ()
Returns the health check service.
Defined at line 100 of file ../../third_party/grpc-migrating/src/include/grpcpp/server.h
void ~Server ()
void Wait ()
Block until the server shuts down.
void SetGlobalCallbacks (GlobalCallbacks * callbacks)
Set the global callback object. Can only be called once per application.
Does not take ownership of callbacks, and expects the pointed to object
to be alive until all server objects in the process have been destroyed.
The same
object will be used throughout the
application and is shared among all
objects.
grpc_server * c_server ()
Returns a
pointer to the underlying
instance.
EXPERIMENTAL: for internal/test use only
std::shared_ptr<Channel> InProcessChannel (const ChannelArguments & args)
Establish a channel for in-process communication
experimental_type experimental ()
NOTE: The function experimental() is not stable public API. It is a view
to the experimental components of this class. It may be changed or removed
at any time.
Defined at line 129 of file ../../third_party/grpc-migrating/src/include/grpcpp/server.h
Protected Methods
bool RegisterService (const std::string * addr, Service * service)
Register a service. This call does not take ownership of the service.
The service must exist for the lifetime of the Server instance.
int AddListeningPort (const std::string & addr, ServerCredentials * creds)
Try binding the server to the given
endpoint
(port, and optionally including IP address to bind to).
It can be invoked multiple times. Should be used before
starting the server.
Parameters
Returns
bound port number on success, 0 on failure.
void Server (ChannelArguments * args, std::shared_ptr<std::vector<std::unique_ptr<ServerCompletionQueue>>> sync_server_cqs, int min_pollers, int max_pollers, int sync_cq_timeout_msec, std::vector<std::shared_ptr<internal::ExternalConnectionAcceptorImpl>> acceptors, grpc_server_config_fetcher * server_config_fetcher, grpc_resource_quota * server_rq, std::vector<std::unique_ptr<experimental::ServerInterceptorFactoryInterface>> interceptor_creators, experimental::ServerMetricRecorder * server_metric_recorder)
NOTE: This is *NOT* a public API. The server constructors are supposed to
be used by
class only. The constructor will be made
'private' very soon.
Server constructors. To be used by
only.
Parameters
void Start (ServerCompletionQueue ** cqs, size_t num_cqs)
Start the server.
Parameters
grpc_server * server ()
Defined at line 196 of file ../../third_party/grpc-migrating/src/include/grpcpp/server.h
void set_health_check_service (std::unique_ptr<HealthCheckServiceInterface> service)
NOTE: This method is not part of the public API for this class.
Defined at line 199 of file ../../third_party/grpc-migrating/src/include/grpcpp/server.h
ContextAllocator * context_allocator ()
Defined at line 204 of file ../../third_party/grpc-migrating/src/include/grpcpp/server.h
bool health_check_service_disabled ()
NOTE: This method is not part of the public API for this class.
Defined at line 207 of file ../../third_party/grpc-migrating/src/include/grpcpp/server.h
Records
Friends
class ServerInitializer
class ServerBuilder
class AsyncGenericService