#include "../../../../include/zmq.h"
#include <assert.h>
#include <stdlib.h>
#include <thread>
#include <atomic>
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 |
void * | server_ctx = NULL |
void * | server_sock = NULL |
std::atomic< int > | worker_cnt [SERVER_WORKER_COUNT] = {0} |
#define CLIENT_CONNECTION 100 |
Definition at line 24 of file test_multithread.cpp.
#define CLIENT_COUNT 5 |
Definition at line 23 of file test_multithread.cpp.
#define CLIENT_RECONNECT 1000 |
Definition at line 25 of file test_multithread.cpp.
#define MESSAGE_MAX_SIZE 1024 |
Definition at line 27 of file test_multithread.cpp.
#define SERVER_ADDR "tcp://127.0.0.1:12345" |
Definition at line 20 of file test_multithread.cpp.
#define SERVER_WORKER_COUNT 3 |
Definition at line 21 of file test_multithread.cpp.
#define ZMQ_BUILD_DRAFT_API |
Definition at line 10 of file test_multithread.cpp.
void client | ( | int | num | ) |
Definition at line 134 of file test_multithread.cpp.
int main | ( | void | ) |
Definition at line 193 of file test_multithread.cpp.
int message_check | ( | zmq_msg_t * | msg | ) |
Definition at line 46 of file test_multithread.cpp.
Definition at line 33 of file test_multithread.cpp.
void server | ( | ) |
Definition at line 103 of file test_multithread.cpp.
void worker | ( | int | num | ) |
Definition at line 83 of file test_multithread.cpp.
std::atomic<int> client_cnt[CLIENT_COUNT] = { 0 } |
Definition at line 130 of file test_multithread.cpp.
std::atomic<int> client_ready = 0 |
Definition at line 131 of file test_multithread.cpp.
Definition at line 77 of file test_multithread.cpp.
Definition at line 78 of file test_multithread.cpp.
std::atomic<int> worker_cnt[SERVER_WORKER_COUNT] = {0} |
Definition at line 80 of file test_multithread.cpp.