Represents a gRPC server.
More...
#include <server_impl.h>
|
bool | RegisterService (const grpc::string *host, grpc::Service *service) override |
| Register a service. More...
|
|
int | AddListeningPort (const grpc::string &addr, grpc::ServerCredentials *creds) override |
| Try binding the server to the given addr endpoint (port, and optionally including IP address to bind to). More...
|
|
| 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< grpc::internal::ExternalConnectionAcceptorImpl >> acceptors, grpc_resource_quota *server_rq=nullptr, std::vector< std::unique_ptr< grpc::experimental::ServerInterceptorFactoryInterface >> interceptor_creators=std::vector< std::unique_ptr< grpc::experimental::ServerInterceptorFactoryInterface >>()) |
| NOTE: This is NOT a public API. More...
|
|
void | Start (ServerCompletionQueue **cqs, size_t num_cqs) override |
| Start the server. More...
|
|
grpc_server * | server () override |
|
void | set_health_check_service (std::unique_ptr< grpc::HealthCheckServiceInterface > service) |
| NOTE: This method is not part of the public API for this class. More...
|
|
bool | health_check_service_disabled () const |
| NOTE: This method is not part of the public API for this class. More...
|
|
virtual void | Start (::grpc_impl::ServerCompletionQueue **cqs, size_t num_cqs)=0 |
| Start the server. More...
|
|
template<class Message > |
void | RequestAsyncCall (internal::RpcServiceMethod *method, ::grpc_impl::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag, Message *message) |
|
void | RequestAsyncCall (internal::RpcServiceMethod *method, ::grpc_impl::ServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag) |
|
void | RequestAsyncGenericCall (GenericServerContext *context, internal::ServerAsyncStreamingInterface *stream, ::grpc_impl::CompletionQueue *call_cq, ::grpc_impl::ServerCompletionQueue *notification_cq, void *tag) |
|
Represents a gRPC server.
Use a grpc::ServerBuilder to create, configure, and start Server instances.
◆ ~Server()
grpc_impl::Server::~Server |
( |
| ) |
|
◆ Server()
NOTE: This is NOT a public API.
The server constructors are supposed to be used by ServerBuilder class only. The constructor will be made 'private' very soon.
Server constructors. To be used by ServerBuilder only.
- Parameters
-
args | The channel args |
sync_server_cqs | The completion queues to use if the server is a synchronous server (or a hybrid server). The server polls for new RPCs on these queues |
min_pollers | The minimum number of polling threads per server completion queue (in param sync_server_cqs) to use for listening to incoming requests (used only in case of sync server) |
max_pollers | The maximum number of polling threads per server completion queue (in param sync_server_cqs) to use for listening to incoming requests (used only in case of sync server) |
sync_cq_timeout_msec | The timeout to use when calling AsyncNext() on server completion queues passed via sync_server_cqs param. |
◆ AddListeningPort()
Try binding the server to the given addr endpoint (port, and optionally including IP address to bind to).
It can be invoked multiple times. Should be used before starting the server.
- Parameters
-
addr | The address to try to bind to the server (eg, localhost:1234, 192.168.1.1:31416, [::1]:27182, etc.). |
creds | The credentials associated with the server. |
- Returns
- bound port number on success, 0 on failure.
- Warning
- It is an error to call this method on an already started server.
Implements grpc::ServerInterface.
◆ c_server()
Returns a raw pointer to the underlying grpc_server instance.
EXPERIMENTAL: for internal/test use only
◆ 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.
◆ GetHealthCheckService()
Returns the health check service.
◆ health_check_service_disabled()
bool grpc_impl::Server::health_check_service_disabled |
( |
| ) |
const |
|
inlineprotected |
NOTE: This method is not part of the public API for this class.
◆ InProcessChannel()
Establish a channel for in-process communication.
◆ RegisterService()
Register a service.
This call does not take ownership of the service. The service must exist for the lifetime of the Server instance.
Implements grpc::ServerInterface.
◆ server()
|
inlineoverrideprotectedvirtual |
◆ set_health_check_service()
NOTE: This method is not part of the public API for this class.
◆ SetGlobalCallbacks()
static void grpc_impl::Server::SetGlobalCallbacks |
( |
GlobalCallbacks * |
callbacks | ) |
|
|
static |
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 GlobalCallbacks object will be used throughout the application and is shared among all Server objects.
◆ Start()
Start the server.
- Parameters
-
cqs | Completion queues for handling asynchronous services. The caller is required to keep all completion queues live until the server is destroyed. |
num_cqs | How many completion queues does cqs hold. |
◆ Wait()
void grpc_impl::Server::Wait |
( |
| ) |
|
|
overridevirtual |
Block until the server shuts down.
- Warning
- The server must be either shutting down or some other thread must call Shutdown for this function to ever return.
Implements grpc::ServerInterface.
◆ grpc::AsyncGenericService
◆ grpc_impl::ServerBuilder
◆ grpc_impl::ServerInitializer
The documentation for this class was generated from the following file: