Overview Tutorial API reference Examples Build Download | ZmqMessage 0.1 - 21 Oct 2011 |
#include "pthread.h"
#include <cstddef>
#include <cassert>
#include <cstring>
#include <iostream>
#include "ZmqMessage.hpp"
#include "../examples/StringFace.hpp"
Defines | |
#define | ZMQMESSAGE_LOG_STREAM ZMQMESSAGE_LOG_STREAM_NONE |
#define | ARRAY_LEN(arr) sizeof(arr)/sizeof((arr)[0]) |
Functions | |
zmq::context_t | ctx (1) |
void | raw_sender (zmq::socket_t &s) |
void | multipart_sender (zmq::socket_t &s) |
void * | raw_receiver (void *arg) |
void * | multipart_receiver (void *arg) |
int | main (int, char **) |
Variables | |
char * | endpoint_raw = "inproc://simple-test-raw" |
char * | endpoint_mes = "inproc://simple-test-mes" |
const char | PART1 [] = "01234567890" |
const char | PART2 [] = "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee" |
const char | PART3 [] = "aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd" |
const char * | req_parts [] = {"part1", "part2", "part3"} |
const size_t | ITERS = 100000 |
Copyright (c) 2010-2011 Phorm, Inc. GNU LGPL v 3.0, see http://www.gnu.org/licenses/lgpl-3.0-standalone.html
We make 100000 request-response transactions between 2 threads and print results.
#define ARRAY_LEN | ( | arr | ) | sizeof(arr)/sizeof((arr)[0]) |
#define ZMQMESSAGE_LOG_STREAM ZMQMESSAGE_LOG_STREAM_NONE |
Variable or macro to stream log messages to (with operator <<). This enables you to adapt ZmqMessage to you logging system. By default, std::cerr is used (when NDEBUG macro is set), otherwise ZmqMessage is silent. If you want to disable logging even for debug builds, use ZMQMESSAGE_LOG_STREAM_NONE
#define ZMQMESSAGE_LOG_STREAM ZMQMESSAGE_LOG_STREAM_NONE
zmq::context_t ctx | ( | 1 | ) |
int main | ( | int | , | |
char ** | ||||
) |
void* multipart_receiver | ( | void * | arg | ) |
void multipart_sender | ( | zmq::socket_t & | s | ) |
void* raw_receiver | ( | void * | arg | ) |
void raw_sender | ( | zmq::socket_t & | s | ) |
char* endpoint_mes = "inproc://simple-test-mes" |
char* endpoint_raw = "inproc://simple-test-raw" |
const size_t ITERS = 100000 |
const char PART1[] = "01234567890" |
const char PART2[] = "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee" |
const char PART3[] = "aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd" |
const char* req_parts[] = {"part1", "part2", "part3"} |