Open Lighting Architecture  Latest Git
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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

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

Create a new session object.

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

Member Function Documentation

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

Returns the underlying RPCChannel.

The RPCChannel that corresponds to this session.
void* ola::rpc::RpcSession::GetData ( ) const

Retrieve the user data associated with this session.

The user data associated with the session.
void ola::rpc::RpcSession::SetData ( void *  ptr)

Associate user data with this session.

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

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