Macros | Functions | Variables
test_multithread.cpp File Reference
#include "../../../../include/zmq.h"
#include <assert.h>
#include <stdlib.h>
#include <thread>
#include <atomic>
Include dependency graph for test_multithread.cpp:

Go to the source code of this file.

Macros

#define CLIENT_CONNECTION   100
 
#define CLIENT_COUNT   5
 
#define CLIENT_RECONNECT   1000
 
#define MESSAGE_MAX_SIZE   1024
 
#define SERVER_ADDR   "tcp://127.0.0.1:12345"
 
#define SERVER_WORKER_COUNT   3
 
#define ZMQ_BUILD_DRAFT_API
 

Functions

void client (int num)
 
int main (void)
 
int message_check (zmq_msg_t *msg)
 
void message_fill (zmq_msg_t *msg, int val)
 
void server ()
 
void worker (int num)
 

Variables

std::atomic< int > client_cnt [CLIENT_COUNT] = { 0 }
 
std::atomic< int > client_ready = 0
 
voidserver_ctx = NULL
 
voidserver_sock = NULL
 
std::atomic< int > worker_cnt [SERVER_WORKER_COUNT] = {0}
 

Macro Definition Documentation

◆ CLIENT_CONNECTION

#define CLIENT_CONNECTION   100

Definition at line 24 of file test_multithread.cpp.

◆ CLIENT_COUNT

#define CLIENT_COUNT   5

Definition at line 23 of file test_multithread.cpp.

◆ CLIENT_RECONNECT

#define CLIENT_RECONNECT   1000

Definition at line 25 of file test_multithread.cpp.

◆ MESSAGE_MAX_SIZE

#define MESSAGE_MAX_SIZE   1024

Definition at line 27 of file test_multithread.cpp.

◆ SERVER_ADDR

#define SERVER_ADDR   "tcp://127.0.0.1:12345"

Definition at line 20 of file test_multithread.cpp.

◆ SERVER_WORKER_COUNT

#define SERVER_WORKER_COUNT   3

Definition at line 21 of file test_multithread.cpp.

◆ ZMQ_BUILD_DRAFT_API

#define ZMQ_BUILD_DRAFT_API

Definition at line 10 of file test_multithread.cpp.

Function Documentation

◆ client()

void client ( int  num)

Definition at line 134 of file test_multithread.cpp.

◆ main()

int main ( void  )

Definition at line 193 of file test_multithread.cpp.

◆ message_check()

int message_check ( zmq_msg_t msg)

Definition at line 46 of file test_multithread.cpp.

◆ message_fill()

void message_fill ( zmq_msg_t msg,
int  val 
)

Definition at line 33 of file test_multithread.cpp.

◆ server()

void server ( )

Definition at line 103 of file test_multithread.cpp.

◆ worker()

void worker ( int  num)

Definition at line 83 of file test_multithread.cpp.

Variable Documentation

◆ client_cnt

std::atomic<int> client_cnt[CLIENT_COUNT] = { 0 }

Definition at line 130 of file test_multithread.cpp.

◆ client_ready

std::atomic<int> client_ready = 0

Definition at line 131 of file test_multithread.cpp.

◆ server_ctx

void* server_ctx = NULL

Definition at line 77 of file test_multithread.cpp.

◆ server_sock

void* server_sock = NULL

Definition at line 78 of file test_multithread.cpp.

◆ worker_cnt

std::atomic<int> worker_cnt[SERVER_WORKER_COUNT] = {0}

Definition at line 80 of file test_multithread.cpp.



libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:04