CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
Loading...
Searching...
No Matches
receive_buffer.h File Reference

This file contains the external definitions for the receive payload delay buffer. More...

#include "endpoint_manager.h"
#include "private.h"

Go to the source code of this file.

Typedefs

typedef struct ReceiveBufferStateReceiveBufferHandle
 Forward declaration of a receive buffer handle type.
 

Functions

CdiReturnStatus RxBufferInit (CdiLogHandle log_handle, CdiPoolHandle error_message_pool, int buffer_delay_ms, int max_rx_payloads, CdiQueueHandle output_queue_handle, ReceiveBufferHandle *receive_buffer_handle_ptr, CdiQueueHandle *input_queue_handle_ptr)
 
void RxBufferDestroy (ReceiveBufferHandle receive_buffer_handle)
 

Detailed Description

This file contains the external definitions for the receive payload delay buffer.

Function Documentation

◆ RxBufferDestroy()

void RxBufferDestroy ( ReceiveBufferHandle receive_buffer_handle)

Destroys the receive delay buffer specified by the handle. Payloads currently in the delay line are pushed to the output queue then the associate thread is shut down and joined and all resources allocated are freed.

Parameters
receive_buffer_handleHandle for the receive delay buffer to destroy.

◆ RxBufferInit()

CdiReturnStatus RxBufferInit ( CdiLogHandle log_handle,
CdiPoolHandle error_message_pool,
int buffer_delay_ms,
int max_rx_payloads,
CdiQueueHandle output_queue_handle,
ReceiveBufferHandle * receive_buffer_handle_ptr,
CdiQueueHandle * input_queue_handle_ptr )

Creates a receive delay buffer of the specified length, allocating all of the associated resources.

Parameters
log_handleHandle to the logger to be used for any messages from this module.
error_message_poolHandle to the pool to which error messages are to be freed in the event that an internal error prevents an input payload from being sent to the next stage.
buffer_delay_msThe number of milliseconds to delay each payload, more or less, depending on each payload's timestamp value.
max_rx_payloadsThe number of objects to allocate for holding payloads in the delay buffer.
output_queue_handleHandle to which the receive delay buffer is to send payloads after they've been delayed.
receive_buffer_handle_ptrAddress of where to write the receive delay buffer's handle if successfully created.
input_queue_handle_ptrAddress to write the handle for the receive delay buffer's input queue if creation was successful.
Returns
CdiReturnStatus kCdiStatusOk if the recieve delay buffer was successfully created or kCdiStatusNotEnoughMemory if memory was insufficient to allocate all of the required resources.