NPRPC docs

struct SessionContext

C++

struct SessionContext

One client connection as seen by a servant: who is calling, and the state that lives as long as the connection. Get the current one with get_context() inside a servant method.

include/nprpc/session_context.h:51

Fields

std::string_view cookies

HTTP-only: value of the incoming Cookie: header (valid during dispatch). Empty for all non-HTTP transports (TCP/WS/SHM).

include/nprpc/session_context.h:68

ReferenceList ref_list

Servants this client holds references to.

include/nprpc/session_context.h:55

EndPoint remote_endpoint

The client's address and transport.

include/nprpc/session_context.h:53

flat_buffer *rx_buffer = nullptr

The request being dispatched and the reply being built; runtime use.

include/nprpc/session_context.h:61

std::vector<std::string> set_cookies

HTTP-only: Set-Cookie header values to attach to the HTTP response. Servants append to this via nprpc::http::set_cookie(). Ignored for all non-HTTP transports.

include/nprpc/session_context.h:73

impl::SharedMemoryChannel *shm_channel = nullptr

For server-side shared memory sessions, points to the channel for zero-copy responses; nullptr for all other session types (TCP, WebSocket, client-side, etc.)

include/nprpc/session_context.h:59

impl::StreamManager *stream_manager = nullptr

Streams open on this session; runtime use.

include/nprpc/session_context.h:64

flat_buffer *tx_buffer = nullptr

The request being dispatched and the reply being built; runtime use.

include/nprpc/session_context.h:61