mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-03-01 10:57:59 +01:00

* Problem: poller can segfault when modified from registred handler. It is possible that a user would like to add/remove sockets from handlers. As handlers and poll items might be removed while not being processed yet - we have a segfault situation. Provided unit test `remove_from_handler` demonstrates the problem. Solution: Modify internal poll item data structure only after processing of events is finished. Please not that events processing path performance remains the same when there are no modification (add/remove) to the poller (no rebuild) - main real use case. As an effect of changes `size()` method has been removed as it does not represent any meaningful information anymore. There are active and pending (waiting for rebuild) poll items so two different sizes. User can easily track on their side number of registered sockets if original size information is needed. `wait` method returns number of processed sockets now. It might be useful information to a user for no extra cost.
This is C++ binding for 0MQ
The contribution policy is at: http://rfc.zeromq.org/spec:22
Build steps:
-
Build libzmq via cmake. This does an out of source build and installs the build files
- download and unzip the lib, cd to directory
- mkdir build
- cd build
- cmake ..
- sudo make -j4 install
-
Build cppzmq via cmake. This does an out of source build and installs the build files
- download and unzip the lib, cd to directory
- mkdir build
- cd build
- cmake ..
- sudo make -j4 install
Using this:
A cmake find package scripts is provided for you to easily include this library. Add these lines in your CMakeLists.txt to include the headers and library files of cpp zmq (which will also include libzmq for you).
#find cppzmq wrapper, installed by make of cppzmq
find_package(cppzmq)
if(cppzmq_FOUND)
include_directories(${ZeroMQ_INCLUDE_DIR} ${cppzmq_INCLUDE_DIR})
target_link_libraries(*Your Project Name* ${cppzmq_LIBRARY})
endif()
Description
Languages
C++
96.2%
CMake
3.5%
Shell
0.3%