Steve I just checked via Wireshark. It is doing PUB side filtering. Are you
sure that you are testing this with zmq 3.1? I setup a simple PUB/SUB in
zeromq.node <https://github.com/shripadk/zeromq.node> fork. Here is my test
code:
// subscriber:
var zmq = require('zmq-3.0');
var sub = zmq.createSocket('sub');
sub.connect('tcp://0.0.0.0:3333');
sub.on('message', function(buf) {
console.log(buf.toString());
});
sub.subscribe('a');
// publisher:
Array.prototype.rotate = function() {
var elem = this.shift();
this.push(elem);
return elem;
};
var zmq = require('zmq-3.0');
var pub = zmq.createSocket('pub');
pub.bindSync('tcp://0.0.0.0:3333');
var arr = ['a', 'b', 'c'];
var count = 0;
setInterval(function() {
pub.send( arr.rotate() + ':' + (count++) );
}, 2500);
With 2.1 Wireshark shows that it is performing a subscriber side filtering.
Not with 3.1 though.
On Wed, Mar 14, 2012 at 1:05 PM, Ian Barber <[email protected]> wrote:
>
>
> On Wed, Mar 14, 2012 at 1:31 AM, Joshua Foster <[email protected]> wrote:
>
>> PUB functions the same in 3.1 as 2.1, but XPUB actually does publisher
>> side filtering. (if I read the code correctly)
>>
>> Joshua
>>
>
> Don't think you did Joshua - they both use the same distribution code
> (dist/send to matching). Pub is really just a very thin wrapper around
> Xpub, and removes the recving of subs to the app code.
>
> Ian
>
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev