[zeromq-dev] Fwd: Exact matching on subscription topics
Martin Sustrik
sustrik at 250bpm.com
Thu Jan 19 01:52:40 CET 2012
On 01/19/2012 01:41 AM, Staffan Gimåker wrote:
> Do you have any opinions on how the public API for this should look?
> I've started implementing this stuff so it'd be nice to know sooner
> rather than later :D
>
> I'm thinking along the lines of just adding more socketops for this, e.g.:
>
> zmq_setsockopt(sock, ZMQ_SUBSCRIBE_EXACT, topic, topic_len);
>
> Any other suggestions?
Taking backward compatibility into account, I would propose following API:
int filter = ZMQ_FILTER_EXACT;
zmq_setsockopt (s, ZMQ_FILTER, &filter, sizeof (filter));
zmq_setsockopt (s, ZMQ_SUBSCRIBE, "ABC", 3);
The default value for ZMQ_FILTER option would be ZMQ_FILTER_PREFIX.
Thoughts?
Martin
More information about the zeromq-dev
mailing list