[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zeromq-dev
Subject:    Re: [zeromq-dev] nzmqt question: how to stop?
From:       Marco Trapanese <marcotrapanese () gmail ! com>
Date:       2012-05-29 3:20:58
Message-ID: jq1faq$jbv$1 () dough ! gmane ! org
[Download RAW message or body]

Il 27/05/2012 09:57, Marco Trapanese ha scritto:

> Yet another lack in my knowledge. I read the doc about the HWM option
> and I found this example (durable but cynical publisher):


Perhaps this isn't the right place to ask questions about nzmqt?

Marco

--



> void *context = zmq_init (1);
> void *publisher = zmq_socket (context, ZMQ_PUB);
> uint64_t hwm = 1;	// I won't set to one, btw
> zmq_setsockopt (publisher, ZMQ_HWM,&hwm, sizeof (hwm));
> zmq_bind (publisher, "tcp://*:5565")
>
>
> But when in my code I write this:
>
> FemtoServer::FemtoServer(QString serverAddr, QObject *parent) :
> QObject(parent), m_serverAddr(serverAddr) {
>       m_dealers.clear();
>       ZMQContext* context = createDefaultContext(this);
>       context->start();
>       m_socket = context->createSocket(ZMQSocket::TYP_ROUTER);
>       m_socket->setLinger(0);
>       connect(m_socket, SIGNAL(messageReceived(const
> QList<QByteArray>&)), this, SLOT(requestReceived(const
> QList<QByteArray>&)));
> }
>
> void FemtoServer::run() {
>       m_socket->setOption(ZMQSocket::OPT_HWM, 8); // here the error fires
>       m_socket->bindTo(m_serverAddr);
> }
>
> The program crashes and returns:
>
> terminate called after throwing an instance of 'zmq::error_t'
>     what():  Argomento non valido
>
>
> Is there any evidence of mistakes?
>
> Thanks!
> Marco


_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic