[zeromq-dev] ZeroMQ 4.0.4 stable released

Frank Hartmann soundart at gmx.net
Sun Mar 16 10:30:51 CET 2014


Hi Pieter and ZMQers,

thank you very much for this release! 

I was using libzmq around 4.0.0 from git before and found no
regressions.  I am using DEALER-ROUTER sockets with tcp on localhost for
controlling subprocesses. The link has heartbeating and on top of that
the processes can exchange messages. Basically a central process
launches short living workers, and receives results back. If the
subprocess hangs or crashes it will be detected by missing heartbeats
and finally be killed.

So now my questions related to 4.0.4:

The CMake flow did not make it into stable? Was there a special reason?
I am using cmake as it allows using the same setup on Linux and Windows.
If there were specific shortcomings I could try to fix them and send a
patch...

And finally I tried the CURVE encryption stuff as I was really curious.
Enabling it was very easy and non intruisive, congratulations! 

Obviously I cannot really judge if it encrypts well, but from looking at
wireshark traces it looks like a lot of structure is still visible after
encryption: I had the impression that I could still distinguish messages
and as my jobs only exchange a limited number of messages with different
length I felt I could "decrypt" the communication easily. Messages were
"I am alive", "Me too", "Result: true", "Result: false". Is this
something I should avoid, by making all messages same length? Or are
there better approaches?

Occasionally(More often on windows and when using debug builds and
playing with larger messages - around 200mb as padded size, but
happening on linux too) some tests were showing problems. I did printf
debugging and found that the problems seems to come from(correlate to)
the version check at the top of the zap handler which I copied from
test_security_curve.cpp:

//  --------------------------------------------------------------------------
//  Encode a binary frame as a string; destination string MUST be at least
//  size * 5 / 4 bytes long plus 1 byte for the null terminator. Returns
//  dest. Size must be a multiple of 4.

static void zap_handler (void *handler)
{
    //  Process ZAP requests forever
    while (true) {
        char *version = s_recv (handler);
        if (!version)
            printf("PROBLEM");
            break;          //  Terminating
            ....
    }
}

Do you have experienced any reasons why the version should vary
occasionally? 

Currently it feels like some sort of race somewhere. Does the client
block while the encryption is established or could it happen, that the
first message is sent while other mechanism are still exchanging keys?

BTW: The comment above the zap_handler does not make sense to me, should
it?

kind regards
  Frank




More information about the zeromq-dev mailing list