Pergunta

Does the order matters for creating publisher and subscribers? If i have application A, that acts as a publisher and several client-applications X1 - Xn (as subscribers to application A), can i first start up the sub-applications, register them as subscribers and later on start up application A? WOuld this work out or do i need to start up application A?

Foi útil?

Solução

http://api.zeromq.org/3-2:zmq-connect

"for most transports and socket types the connection is not performed immediately but as needed by ØMQ. Thus a successful call to zmq_connect() does not mean that the connection was or could actually be established. Because of this, for most transports and socket types the order in which a server socket is bound and a client socket is connected to it does not matter. The first exception is when using the inproc:// transport: you must call zmq_bind() before calling zmq_connect(). The second exception are ZMQ_PAIR sockets, which do not automatically reconnect to endpoints."

Read more about some sub/pub issues: http://zguide.zeromq.org/page:all#Getting-the-Message-Out

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top