Open Lighting Architecture  Latest Git
Classes | Public Member Functions | List of all members
ola::rpc::RpcServer Class Reference

Detailed Description

An RPC server.

The RPCServer starts listening on 127.0.0.0:[listen_port] for new client connections. After accepting a new client connection it calls RpcSessionHandlerInterface::NewClient() on the session_handler. For each RPC it then invokes the correct method from the RpcService object.

Finally when each client disconnects, it calls RpcSessionHandlerInterface::ClientRemoved() on the session_handler.

Classes

struct  Options
 Options for the RpcServer. More...
 

Public Member Functions

 RpcServer (ola::io::SelectServerInterface *ss, class RpcService *service, class RpcSessionHandlerInterface *session_handler, const Options &options)
 Create a new RpcServer. More...
 
bool Init ()
 Initialize the RpcServer. More...
 
ola::network::GenericSocketAddress ListenAddress ()
 Return the address this RpcServer is listening on. More...
 
bool AddClient (ola::io::ConnectedDescriptor *descriptor)
 Manually attach a new client on the given descriptor. More...
 

Constructor & Destructor Documentation

◆ RpcServer()

ola::rpc::RpcServer::RpcServer ( ola::io::SelectServerInterface ss,
class RpcService service,
class RpcSessionHandlerInterface session_handler,
const Options options 
)

Create a new RpcServer.

Parameters
ssThe SelectServer to use.
serviceThe RPCService to expose.
session_handlerthe RpcSessionHandlerInterface to use for client connect / disconnect notifications.
optionsOptions for the RpcServer.

Member Function Documentation

◆ AddClient()

bool ola::rpc::RpcServer::AddClient ( ola::io::ConnectedDescriptor descriptor)

Manually attach a new client on the given descriptor.

Parameters
descriptorThe ConnectedDescriptor that the client is using. Ownership of the descriptor is transferred.

◆ Init()

bool ola::rpc::RpcServer::Init ( )

Initialize the RpcServer.

Returns
true if initialization succeeded, false if it failed.

◆ ListenAddress()

GenericSocketAddress ola::rpc::RpcServer::ListenAddress ( )

Return the address this RpcServer is listening on.

Returns
The SocketAddress this RpcServer is listening on.

The documentation for this class was generated from the following files: