Defines gRPC Server
functionality.
More...
#include "rpc/server.hpp"
|
void | start () |
| Starts the grpc server. Can only be called once.
|
|
void | register_service (grpc::Service *service) |
| Registers a gRPC service.
|
|
std::shared_ptr< ResourceServer > | lookup_resource_server (const API &api) |
| Returns reference to managed resource server.
|
|
void | add_resource (std::shared_ptr< Resource > resource) |
| Adds a specific managed resource to the associated resource server.
|
|
void | add_listening_port (const std::string &address, std::shared_ptr< grpc::ServerCredentials > creds=nullptr) |
| Adds a listening port to the server.
|
|
void | wait () |
| waits on server close, only returning when the server is closed.
|
|
void | shutdown () |
| Shutdown the gRPC server.
|
|
|
class | ::viam::sdktests::TestServer |
|
Defines gRPC Server
functionality.
◆ add_listening_port()
void viam::sdk::Server::add_listening_port |
( |
const std::string & | address, |
|
|
std::shared_ptr< grpc::ServerCredentials > | creds = nullptr ) |
Adds a listening port to the server.
- Parameters
-
address | The address to listen at. |
creds | The server credentials; defaults to a insecure server credentials. |
- Exceptions
-
`Exception` | if called after the server has been start ed. |
◆ add_resource()
void viam::sdk::Server::add_resource |
( |
std::shared_ptr< Resource > | resource | ) |
|
Adds a specific managed resource to the associated resource server.
- Parameters
-
resource | The resource to add |
- Exceptions
-
◆ lookup_resource_server()
std::shared_ptr< ResourceServer > viam::sdk::Server::lookup_resource_server |
( |
const API & | api | ) |
|
Returns reference to managed resource server.
- Parameters
-
api | The api of the managed resource server. |
- Returns
- The requested resource server, or nullptr if it doesn't exist.
◆ register_service()
void viam::sdk::Server::register_service |
( |
grpc::Service * | service | ) |
|
Registers a gRPC service.
- Parameters
-
service | The gRPC service to be registered. |
- Exceptions
-
`Exception` | if called after the server has been start ed. |
◆ start()
void viam::sdk::Server::start |
( |
| ) |
|
Starts the grpc server. Can only be called once.
- Exceptions
-
`Exception` | if the server was already start ed. repeated calls. |
The documentation for this class was generated from the following file: