<commit_before>zmqHelper
=========

Helper class and functions on top of zmq C++ binding.

* Customize example/Makefile.in to your local settings (where your zmq library is).

<<<<<<< HEAD
* The guide says: "If you're sharing sockets across threads, don't. It
will lead to random weirdness, and crashes."
	  We have here one dedicated thread waiting for incoming data (onMessage()) which
	calls the user provided callback() to handle it.
 Thus, danger is limited to the case when the calback is reading data, and
 the main or a different thread sends data or is doing something else with the socket.
 (There  is  a branch  'threadSafety'  to  explore the  protection  of
 send/rec functions with lock/unlock pairs).
=======
>>>>>>> threadSafety

* Usage example (just examples/04-REQ-broker-REP/broker.cpp)


```cpp
#include <zmq.hpp>
#include <string>
#include <iostream>

#include "../../zmqHelper.h"

using namespace zmqHelper;

// -----------------------------------------------------------------
int main ()
{

  SocketAdaptor< ZMQ_ROUTER > frontend_ROUTER;
  SocketAdaptor< ZMQ_DEALER > backend_DEALER;<commit_msg>minor edit<commit_after>zmqHelper
=========

Helper class and functions on top of zmq C++ binding.

* Customize example/Makefile.in to your local settings (where your zmq library is).

* The guide says: "If you're sharing sockets across threads, don't. It
will lead to random weirdness, and crashes."
  We have here one dedicated thread waiting for incoming data (onMessage()) which
	calls the user provided callback() to handle it.
 Thus, danger is limited to the case when the calback is reading data, and
 the main or a different thread sends data or is doing something else with the socket.
 (sendText() receiveText() are protected through a lock).

* Usage example (just examples/04-REQ-broker-REP/broker.cpp)


```cpp
#include <zmq.hpp>
#include <string>
#include <iostream>

#include "../../zmqHelper.h"

using namespace zmqHelper;

// -----------------------------------------------------------------
int main ()
{

  SocketAdaptor< ZMQ_ROUTER > frontend_ROUTER;
  SocketAdaptor< ZMQ_DEALER > backend_DEALER;
{'fraction_non_alphanumeric': 0.15683520599250936, 'fraction_numerical': 0.0018726591760299626, 'mean_word_length': 3.2233201581027666, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1386507', 'n_tokens_mistral': 632, 'n_tokens_neox': 602, 'n_words': 252}