[zeromq-dev] ZMQ_STREAM interraction with ZMTP ?

Pieter Hintjens ph at imatix.com
Fri Dec 6 20:02:46 CET 2013


On Fri, Dec 6, 2013 at 4:26 PM, Laurent Alebarde <l.alebarde at free.fr> wrote:
> Here is my test code (one single commit in my master) :
> https://github.com/lalebarde/libzmq/commit/2d38f19249d2a4f5dcc4d1d5ec907a092d6a8266

This code is not correct:

    // Frontend socket talks to clients over TCP
    void *frontend = zmq_socket (ctx, ZMQ_ROUTER);
    assert (frontend);
    int as_server = 1;
    int rc = zmq_setsockopt (frontend, ZMQ_STREAM, &as_server, sizeof (int));
    assert (rc == 0);

It should say:

    void *frontend = zmq_socket (ctx, ZMQ_STREAM);
    assert (frontend);

Please re-read the documentation for ZMQ_STREAM and look at the test case.

-Pieter



More information about the zeromq-dev mailing list