Skip to content

File stream.h

FileList > inc > stream > stream.h

Go to the source code of this file

Streaming API for doppler — PUB/SUB, PUSH/PULL, REQ/REP. More...

  • #include <complex.h>
  • #include <stddef.h>
  • #include <stdint.h>
  • #include "clib_common.h"

Classes

Type Name
struct dp_header_t
Frame metadata header carried in every ZMQ message.

Detailed Description

Provides ZMQ-backed signal streaming using three messaging patterns:

Pattern Sender function Receiver function Use case
PUB/SUB dp_pub_* dp_sub_* Fan-out broadcast
PUSH/PULL dp_push_* dp_pull_* Pipeline /

load-balance| | REQ/REP | dp_req_* | dp_rep_* | Control / metadata |

Quick start (C)

#include "stream/stream.h"

// Transmitter
dp_pub_t *pub = dp_pub_create("tcp://\*:5555", CF64);
double _Complex samples[1024] = { ... };
dp_pub_send_cf64(pub, samples, 1024, 1e6, 2.4e9);
dp_pub_destroy(pub);

// Receiver (zero-copy)
dp_sub_t *sub = dp_sub_create("tcp://localhost:5555");
dp_msg_t *msg;  dp_header_t hdr;
dp_sub_recv(sub, &msg, &hdr);
double _Complex *cf64 = (double _Complex *)dp_msg_data(msg);
size_t n = dp_msg_num_samples(msg);
// use cf64[0..n-1] ...
dp_msg_free(msg);
dp_sub_destroy(sub);

The documentation for this class was generated from the following file native/inc/stream/stream.h