Open Lighting Architecture  0.9.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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.
bool Init ()
 Initialize the RpcServer.
ola::network::GenericSocketAddress ListenAddress ()
 Return the address this RpcServer is listening on.
bool AddClient (ola::io::ConnectedDescriptor *descriptor)
 Manually attach a new client on the given descriptor.

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.

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

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.
bool ola::rpc::RpcServer::Init ( )

Initialize the RpcServer.

Returns
true if initialization succeeded, false if it failed.
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: