Models a gRPC server.
More...
#include <server_interface.h>
|
| virtual | ~ServerInterface () |
| |
| template<class T > |
| void | Shutdown (const T &deadline) |
| | Shutdown the server, blocking until all rpc processing finishes. More...
|
| |
| void | Shutdown () |
| | Shutdown the server, waiting for all rpc processing to finish. More...
|
| |
| virtual void | Wait ()=0 |
| | Block waiting for all work to complete. More...
|
| |
| virtual | ~CallHook () |
| |
|
| virtual bool | RegisterService (const grpc::string *host, Service *service)=0 |
| | Register a service. More...
|
| |
| virtual void | RegisterAsyncGenericService (AsyncGenericService *service)=0 |
| | Register a generic service. More...
|
| |
| virtual int | AddListeningPort (const grpc::string &addr, ServerCredentials *creds)=0 |
| | Tries to bind server to the given addr. More...
|
| |
| virtual bool | Start (ServerCompletionQueue **cqs, size_t num_cqs)=0 |
| | Start the server. More...
|
| |
| virtual void | RunRpc ()=0 |
| | Process one or more incoming calls. More...
|
| |
| virtual void | ScheduleCallback ()=0 |
| | Schedule RunRpc to run in the threadpool. More...
|
| |
| virtual void | ShutdownInternal (gpr_timespec deadline)=0 |
| |
| virtual int | max_message_size () const =0 |
| |
| virtual grpc_server * | server ()=0 |
| |
| virtual void | PerformOpsOnCall (CallOpSetInterface *ops, Call *call)=0 |
| |
| template<class Message > |
| void | RequestAsyncCall (RpcServiceMethod *method, ServerContext *context, ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag, Message *message) |
| |
| void | RequestAsyncCall (RpcServiceMethod *method, ServerContext *context, ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag) |
| |
| void | RequestAsyncGenericCall (GenericServerContext *context, ServerAsyncStreamingInterface *stream, CompletionQueue *call_cq, ServerCompletionQueue *notification_cq, void *tag) |
| |
Models a gRPC server.
Servers are configured and started via grpc::ServerBuilder.
| virtual grpc::ServerInterface::~ServerInterface |
( |
| ) |
|
|
inlinevirtual |
Tries to bind server to the given addr.
It can be invoked multiple times.
- 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 sucess, 0 on failure.
- Warning
- It's an error to call this method on an already started server.
| virtual int grpc::ServerInterface::max_message_size |
( |
| ) |
const |
|
protectedpure virtual |
| virtual void grpc::ServerInterface::RegisterAsyncGenericService |
( |
AsyncGenericService * |
service | ) |
|
|
protectedpure virtual |
Register a generic service.
This call does not take ownership of the service. The service must exist for the lifetime of the Server instance.
| virtual bool grpc::ServerInterface::RegisterService |
( |
const grpc::string * |
host, |
|
|
Service * |
service |
|
) |
| |
|
protectedpure virtual |
Register a service.
This call does not take ownership of the service. The service must exist for the lifetime of the Server instance.
| virtual void grpc::ServerInterface::RunRpc |
( |
| ) |
|
|
protectedpure virtual |
Process one or more incoming calls.
| virtual void grpc::ServerInterface::ScheduleCallback |
( |
| ) |
|
|
protectedpure virtual |
Schedule RunRpc to run in the threadpool.
| virtual grpc_server* grpc::ServerInterface::server |
( |
| ) |
|
|
protectedpure virtual |
template<class T >
| void grpc::ServerInterface::Shutdown |
( |
const T & |
deadline | ) |
|
|
inline |
Shutdown the server, blocking until all rpc processing finishes.
Forcefully terminate pending calls after deadline expires.
- Parameters
-
| deadline | How long to wait until pending rpcs are forcefully terminated. |
| void grpc::ServerInterface::Shutdown |
( |
| ) |
|
|
inline |
Shutdown the server, waiting for all rpc processing to finish.
| virtual void grpc::ServerInterface::ShutdownInternal |
( |
gpr_timespec |
deadline | ) |
|
|
protectedpure virtual |
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. |
- Returns
- true on a successful shutdown.
| virtual void grpc::ServerInterface::Wait |
( |
| ) |
|
|
pure virtual |
Block waiting for all work to complete.
- Warning
- The server must be either shutting down or some other thread must call Shutdown for this function to ever return.
Implemented in grpc::Server.
The documentation for this class was generated from the following file: