Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | List of all members
ola::rpc::RpcServer Class Reference

Detailed Description

An RPC server.

The RPCServer starts listening on[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.


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

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

Create a new RpcServer.

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

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

Manually attach a new client on the given descriptor.

descriptorThe ConnectedDescriptor that the client is using. Ownership of the descriptor is transferred.
bool ola::rpc::RpcServer::Init ( )

Initialize the RpcServer.

true if initialization succeeded, false if it failed.
GenericSocketAddress ola::rpc::RpcServer::ListenAddress ( )

Return the address this RpcServer is listening on.

The SocketAddress this RpcServer is listening on.

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