ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
kcmcp::Connection Class Reference

Framed message transport over one connected socket fd. More...

#include "kcmcp_protocol.h"

Public Member Functions

 Connection (int fd, uint32_t recv_max, uint32_t send_max)
bool recv (Message &out)
 Read one logical message (concatenating MORE frames).
void send (Type type, uint32_t request_id, const std::string &payload)
 Send a message, splitting payload across MORE-flagged frames no larger than the peer's limit.
void send (Type type, uint32_t request_id)
int fd () const

Private Attributes

int fd_
uint32_t recv_max_
uint32_t send_max_

Detailed Description

Framed message transport over one connected socket fd.

recv_max is the largest single-frame payload this side accepts (its advertised max_payload); send_max is the peer's accept limit, used to split outbound payloads into MORE-flagged frames. Blocking I/O.

Definition at line 103 of file kcmcp_protocol.h.

Constructor & Destructor Documentation

◆ Connection()

kcmcp::Connection::Connection ( int fd,
uint32_t recv_max,
uint32_t send_max )
inline

Definition at line 105 of file kcmcp_protocol.h.

Here is the call graph for this function:

Member Function Documentation

◆ fd()

int kcmcp::Connection::fd ( ) const
inline

Definition at line 118 of file kcmcp_protocol.h.

Here is the caller graph for this function:

◆ recv()

bool kcmcp::Connection::recv ( Message & out)

Read one logical message (concatenating MORE frames).

Returns false on a clean peer close at a frame boundary. Throws ProtocolError on an oversize frame, std::runtime_error on an I/O error or truncation.

Definition at line 103 of file kcmcp_protocol.cpp.

Here is the caller graph for this function:

◆ send() [1/2]

void kcmcp::Connection::send ( Type type,
uint32_t request_id )
inline

Definition at line 116 of file kcmcp_protocol.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send() [2/2]

void kcmcp::Connection::send ( Type type,
uint32_t request_id,
const std::string & payload )

Send a message, splitting payload across MORE-flagged frames no larger than the peer's limit.

Definition at line 159 of file kcmcp_protocol.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ fd_

int kcmcp::Connection::fd_
private

Definition at line 121 of file kcmcp_protocol.h.

◆ recv_max_

uint32_t kcmcp::Connection::recv_max_
private

Definition at line 122 of file kcmcp_protocol.h.

◆ send_max_

uint32_t kcmcp::Connection::send_max_
private

Definition at line 123 of file kcmcp_protocol.h.


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