class ServerInterface
Defined at line 61 of file ../../third_party/grpc-migrating/src/include/grpcpp/server_interface.h
Public Methods
void ~ServerInterface ()
Defined at line 63 of file ../../third_party/grpc-migrating/src/include/grpcpp/server_interface.h
template <class T>
void Shutdown (const T & deadline)
does the following things:
1. Shutdown the server: deactivate all listening ports, mark it in
"shutdown mode" so that further call Request's or incoming RPC matches
are no longer allowed. Also return all Request'ed-but-not-yet-active
calls as failed (!ok). This refers to calls that have been requested
at the server by the server-side library or application code but that
have not yet been matched to incoming RPCs from the client. Note that
this would even include default calls added automatically by the gRPC
C++ API without the user's input (e.g., "Unimplemented RPC method")
2. Block until all rpc method handlers invoked automatically by the sync
API finish.
3. If all pending calls complete (and all their operations are
retrieved by Next) before
expires, this finishes
gracefully. Otherwise, forcefully cancel all pending calls associated
with the server after
expires. In the case of the sync API,
if the RPC function for a streaming call has already been started and
takes a week to complete, the RPC function won't be forcefully
terminated (since that would leave state corrupt and incomplete) and
the method handler will just keep running (which will prevent the
server from completing the "join" operation that it needs to do at
shutdown time).
All completion queue associated with the server (for example, for async
serving) must be shutdown *after* this method has returned:
See
for details.
They must also be drained (by repeated Next) after being shutdown.
Parameters
Defined at line 98 of file ../../third_party/grpc-migrating/src/include/grpcpp/server_interface.h
void Shutdown ()
Shutdown the server without a deadline and forced cancellation.
All completion queue associated with the server (for example, for async
serving) must be shutdown *after* this method has returned:
See
for details.
Defined at line 107 of file ../../third_party/grpc-migrating/src/include/grpcpp/server_interface.h
void Wait ()
Block waiting for all work to complete.
Protected Methods
bool RegisterService (const std::string * host, 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.
void RegisterAsyncGenericService (AsyncGenericService * service)
Register a generic 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)
Tries to bind
to the given
It can be invoked multiple times.
Parameters
Returns
bound port number on success, 0 on failure.
void RegisterCallbackGenericService (CallbackGenericService * )
Register a callback generic service. This call does not take ownership of
the service. The service must exist for the lifetime of the Server
instance. May not be abstract since this is a post-1.0 API addition.
Defined at line 130 of file ../../third_party/grpc-migrating/src/include/grpcpp/server_interface.h
void Start (grpc::ServerCompletionQueue ** cqs, size_t num_cqs)
Start the server.
Parameters
void ShutdownInternal (gpr_timespec deadline)
int max_receive_message_size ()
grpc_server * server ()
void PerformOpsOnCall (internal::CallOpSetInterface * ops, internal::Call * call)
template <class Message>
void RequestAsyncCall (internal::RpcServiceMethod * method, grpc::ServerContext * context, internal::ServerAsyncStreamingInterface * stream, grpc::CompletionQueue * call_cq, grpc::ServerCompletionQueue * notification_cq, void * tag, Message * message)
Defined at line 317 of file ../../third_party/grpc-migrating/src/include/grpcpp/server_interface.h
void RequestAsyncCall (internal::RpcServiceMethod * method, grpc::ServerContext * context, internal::ServerAsyncStreamingInterface * stream, grpc::CompletionQueue * call_cq, grpc::ServerCompletionQueue * notification_cq, void * tag)
Defined at line 328 of file ../../third_party/grpc-migrating/src/include/grpcpp/server_interface.h
void RequestAsyncGenericCall (GenericServerContext * context, internal::ServerAsyncStreamingInterface * stream, grpc::CompletionQueue * call_cq, grpc::ServerCompletionQueue * notification_cq, void * tag)
Defined at line 339 of file ../../third_party/grpc-migrating/src/include/grpcpp/server_interface.h
Records
Friends
class Service