[nanomsg] Re: Polling implemented

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Fri, 22 Feb 2013 21:11:39 +0100

On 22/02/13 21:08, Charles Remes wrote:
Is there any particular reason why you didn't implement
nn_getevents(int fd, int events, int timeout) as part of the official
nanomsg API? It seems like the getevents() function in tests/poll.c
contains a lot of boiler plate that every programmer is going to have
to duplicate if they want to use the poll functionality.

On second thought, the above statement is probably only true for
programmers who are working (mostly) exclusively with nanomsg
sockets. If they are co-mingling nanomsg sockets, BSD sockets,
regular files, pipes, etc. then their handling of events will
probably be different so the getevents() function is no longer
general enough.

Exactly.

And worse, nn_getevents(fd) doesn't even work for 2 nanomsg sockets. I've implemented the function only for testing purposes. In real-life scenarios it is close to useless.

Martin

Other related posts: