[nanomsg] Survey pattern and polling

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: <nanomsg@xxxxxxxxxxxxx>
  • Date: Thu, 14 Feb 2013 12:30:44 +0100

Hi all,

There's an API problem with survey pattern that I am not sure how to solve and I would appreciate feedback from the community.

SURVEYOR socket works in following way:

1. send survey
2. receive response
3. receive response
4. receive response
etc.
until recv() returns EFSM error

The error means that survey have timed out.

At that point user may opt to start anew and initiate a new survey.

The question is how shoud the timeout be reported when the socket is polled on? Signalling POLLERR would mean that any subsequent polling on the socket -- even for POLLOUT would fail (according to POSIX there's no way to disable reporting POLLERR). Signalling POLLIN is kind of strange given that subsequent recv() will return EFSM error.

Ideas anyone?

Martin

Other related posts: