Re: [zeromq-dev] polling fd with czmq

2019-10-28 Thread Arnaud Loonstra

On 25-10-2019 10:25, Luca Boccassi wrote:

On Thu, 2019-10-24 at 15:35 +0200, Arnaud Loonstra wrote:

Hi all,

I'm wondering what is the best approach to polling a non-zmq socket
using czmq. It doesn't seem documented?

I can add a fd as follows:

...
s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1)
zpoller_add(poller, );
...

If I then poll zpoller_wait returns on activity however it's not a
valid
zsock_t instance:

zsock_t *which = (zsock_t *)zpoller_wait(poller, -1);

zsock_is(which) will return false. I've found 'which' is just what
you
added to the poller so if I cast to an int it will resolve to the
correct filedescriptor number.

So either I cast it back to an int or I keep checking the pointer
addresses. However casting an int to zsock_t doesn't feel safe.

So question is what is best/safest approach?

Rg,

Arnaud


Strange, that should work - the zpoller_add documentation is missing
it, but the zpoller_new doc clearly says a file handle is supported,
and the implementation confirms it - you should be able to pass it a
file descriptor as you are doing.

Did you by any chance compile libzmq with draft apis and the new
zmq_poller APIs? That changes the implementation quite a bit, and there
might be regressions yet unspotted.



It does work, Luca. It just wasn't clear. I submitted a PR:

https://github.com/zeromq/czmq/pull/2028

Rg,

Arnaud
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] mermaid markdown for flow charts

2019-10-28 Thread Benjamin Henrion
Hi,

If you redo the zmq docs, you could use markdown with mermaid:

https://mermaidjs.github.io/#/

It works on gitlab:

https://gitlab.com/zoobab/mermaid-test/blob/master/README.md

But not on github:

https://github.com/zoobab/mermaid-test/blob/master/README.md

Best,

-- 
Benjamin Henrion (zoobab)
Email: zoobab at gmail.com
Mobile: +32-484-566109
Web: http://www.zoobab.com
FFII.org Brussels
"In July 2005, after several failed attempts to legalise software
patents in Europe, the patent establishment changed its strategy.
Instead of explicitly seeking to sanction the patentability of
software, they are now seeking to create a central European patent
court, which would establish and enforce patentability rules in their
favor, without any possibility of correction by competing courts or
democratically elected legislators."
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
https://lists.zeromq.org/mailman/listinfo/zeromq-dev