Skip to content

Some confusion about using nng together with select/poll/epoll on linux #1864

Answered by gdamore
jasmineforever asked this question in Q&A
Discussion options

You must be logged in to vote

What you want is to use the file descriptors that will be created by NNG_OPT_SENDFD and NNG_OPT_RECVFD. These are pollable file descriptors (you poll for readability -- never actually do you read or write them), and they will be readable when the socket can send or recv.

Note that this design comes at a cost, but that's true for nanomsg and ZeroMQ as well... you're doing extra system calls to do this synchronization. But it may be simpler if you need to integrate into an existing select/poll/epoll loop.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gdamore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1861 on August 14, 2024 05:57.