ZmqSocket prototype

This commit is contained in:
Erik Frojdh
2024-04-03 10:50:35 +02:00
parent 6644406535
commit 70b0ae2ae8
7 changed files with 239 additions and 2 deletions

View File

@ -1,5 +1,5 @@
set(EXAMPLE_LIST "json_example;logger_example;numpy_read_example;multiport_example;raw_example")
set(EXAMPLE_LIST "json_example;logger_example;numpy_read_example;multiport_example;raw_example;zmq_example;")
set(EXAMPLE_LIST "${EXAMPLE_LIST};mythen_example;numpy_write_example")
foreach(example ${EXAMPLE_LIST})
add_executable(${example} ${example}.cpp)

19
examples/zmq_example.cpp Normal file
View File

@ -0,0 +1,19 @@
#include <string>
#include <fmt/core.h>
#include "aare/ZmqSocket.hpp"
int main(){
std::string endpoint = "tcp://localhost:5555";
aare::ZmqSocket socket(endpoint);
socket.connect();
char* data = new char[1024*1024*10];
aare::zmqHeader header;
while(true){
int rc = socket.receive(header, reinterpret_cast<std::byte*>(data));
}
delete[] data;
return 0;
}