zeromq.node icon indicating copy to clipboard operation
zeromq.node copied to clipboard

Error: Invalid argument with High Water Mark option

Open anpm2013 opened this issue 10 years ago • 5 comments

Hi every one, I tried the below code with nodejs binding:

var zmq = require('zmq') , pub = zmq.socket('sub');

pub.setsockopt(zmq.ZMQ_HWM, 10000);

pub.bind('tcp://127.0.0.1:5565');

setInterval(function(){ pub.send('some work '); }, 500);

And when i ran the code i got the below error:

/media/DATA/J2EE/NodeJS/node_modules/zmq/lib/index.js:208 this._zmq.setsockopt(opts[opt] || opt, val); ^ Error: Invalid argument at Socket.setsockopt (/media/DATA/J2EE/NodeJS/node_modules/zmq/lib/index.js:208:13)

Could you please tell me how can i solve this problem ? Currently i am using Zeromq platform version 4.0.4

anpm2013 avatar Jul 09 '14 10:07 anpm2013

That should be working as such, however -- there is no actual support for the high water mark in the binding, setting the option does nothing.

On Wednesday 09 July 2014 03:41:00 anpm2013 wrote:

Hi every one, I tried the below code with nodejs binding:

var zmq = require('zmq') , pub = zmq.socket('sub');

pub.setsockopt(zmq.ZMQ_HWM, 10000);

pub.bind('tcp://127.0.0.1:5565');

setInterval(function(){ pub.send('some work '); }, 500);

And when i ran the code i got the below error:

/media/DATA/J2EE/NodeJS/node_modules/zmq/lib/index.js:208 this._zmq.setsockopt(opts[opt] || opt, val); ^ Error: Invalid argument at Socket.setsockopt (/media/DATA/J2EE/NodeJS/node_modules/zmq/lib/index.js:208:13)

Could you please tell me how can i solve this problem ? Currently i am using Zeromq platform version 4.0.4


Reply to this email directly or view it on GitHub: https://github.com/JustinTulloss/zeromq.node/issues/323

kkoopa avatar Jul 09 '14 11:07 kkoopa

Thanks for reply to me, kkoopa ! I also tried with the previous versions and still get exception with version 3.2.4. Via version 2.2.0, it don't throw that exception but does no thing at rune time Before working with node js binding, i have already worked with Java binding and the option HWM work well with version 2.2.0 So, is it impossible to limit message queue memory size by using node js binding until now?

anpm2013 avatar Jul 10 '14 02:07 anpm2013

Yes, it is not supported. Mostly because this uses a zmq poll loop under the hood to multiplex, and nothing should block it.

On July 10, 2014 5:52:15 AM EEST, anpm2013 [email protected] wrote:

Thanks for reply to me, kkoopa ! I also tried with the previous versions and still get exception with version 3.2.4. Via version 2.2.0, it don't throw an exception but does no thing at rune time Before working with node js binding, i have already worked with Java binding and the option HWM work well with version 2.2.0 So, is it impossible to limit message queue memory size by using node js binding until now?


Reply to this email directly or view it on GitHub: https://github.com/JustinTulloss/zeromq.node/issues/323#issuecomment-48559974

kkoopa avatar Jul 10 '14 07:07 kkoopa

Thank you!

anpm2013 avatar Jul 11 '14 10:07 anpm2013

What is the process for waiting for the high water mark to lower? In the node.js net module there is a "drain" event.

Downchuck avatar Oct 21 '15 19:10 Downchuck