Open Lighting Architecture: ola::rpc::RpcServer Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
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

## ◆ RpcServer()

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

Create a new RpcServer.

Parameters

  ss | The SelectServer to use.
  service | The RPCService to expose.
  session_handler | the RpcSessionHandlerInterface to use for client connect / disconnect notifications.
  options | Options 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

  descriptor | The 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:

- common/rpc/RpcServer.h
- common/rpc/RpcServer.cpp