Open modernresearch opened 3 years ago
Can you push your branch, and drop a link to it here?
Alternatively if you make a PR w/ your changes, we can test.
Thanks for the quick response - here's the PR: https://github.com/ropensci/rzmq/pull/57
Let me know if you need anything else!
Your PR seems correct.
I think the issue you are seeing w/ 'Invalid argument' is related to your sock object being invalid.
Please check that before calling set.conflate.
Additionally, you can add a simple check after the setsocketopt call to see if your cmd was successful.
something along these lines (untested): uint64_t option_value_check; // before try block
// add after the call to setsocketopt socket->getsockopt(ZMQ_CONFLATE, &option_value_check, sizeof(uint64_t)); cout << option_value_check << endl;
I don't have time to test locally at this moment, but I can try later this weekend.
Thanks, will check it out and follow up
I'm trying to set option
ZMQ_CONFLATE
to 1 (http://api.zeromq.org/master:zmq-setsockopt) for aZMQ_SUB
socket.I didn't see a built-in function to do that, so I tried to add my own. Here's what I did:
Added function to
R/zmq.R
, following pattern ofset.affinity
:Added
set.conflate
to export list inNAMESPACE
file.Added
set_conflate
function insrc/interface.cpp
, following same pattern asset_affinity
:src/interface.h
in theextern "C"
block:SEXP set_conflate(SEXP socket_, SEXP option_value_);
Deleted
src/rzmq.so
from my prior installation.Re-installed package from source, verified
src/rzmq.so
was re-built.When I tried to use it, it definitely finds the function and tries, but it says the argument is invalid:
Two questions:
1L
is an invalid argument? The docs say it's expecting an integer.ZMQ_CONFLATE
to 1?