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

Detailed Description

Represents the RPC session between a client and server.

The RPCSession object contains information about the session an RPC is part of. For each RPC method on the server side, the RPCSession can be accessed via the RpcController::Session() method.

Sessions can have arbitrary user data associated with them, similar to a cookie in an HTTP request. The user data is usually set in the call to RpcSessionHandlerInterface::NewClient() but can be set or modified in any of the RPC calls themselves.

Since the RPCSession object doesn't take ownership of the user data, its should be deleted in the call to RpcSessionHandlerInterface::ClientRemoved().

Public Member Functions

 RpcSession (RpcChannel *channel)
 Create a new session object. More...
 
RpcChannelChannel ()
 Returns the underlying RPCChannel. More...
 
void SetData (void *ptr)
 Associate user data with this session. More...
 
void * GetData () const
 Retrieve the user data associated with this session. More...
 

Constructor & Destructor Documentation

◆ RpcSession()

ola::rpc::RpcSession::RpcSession ( RpcChannel channel)
inlineexplicit

Create a new session object.

Parameters
channelthe RpcChannel that the session is using. Ownership is not transferred.

Member Function Documentation

◆ Channel()

RpcChannel* ola::rpc::RpcSession::Channel ( )
inline

Returns the underlying RPCChannel.

Returns
The RPCChannel that corresponds to this session.

◆ GetData()

void* ola::rpc::RpcSession::GetData ( ) const
inline

Retrieve the user data associated with this session.

Returns
The user data associated with the session.

◆ SetData()

void ola::rpc::RpcSession::SetData ( void *  ptr)
inline

Associate user data with this session.

Parameters
ptrOpaque user data to associate with this session. Ownership is not transferred.

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