On Mon, 2008-06-02 at 18:13 +0200, rdxesy@email-addr-hidden wrote:
> Now I just wait for an constant time (usleep) before I
> check the input queue. Problem: if the time is too short, i
> would have missed the answer, if I wait to long I waste
> time.
>
> My question is: how would I make sure to catch all answers
> from the device without using a thread and without just
> waiting for an constant time before I check if there is an
> answer( which is alo not very fail save, a message might
> take a little longer if there is traffic on the midibus)?
You /could/ use poll:
#include <poll.h>
int poll(struct pollfd *fds, nfds_t nfds, int timeout);
.. which will block, but at most untill timeout, after which you can
notify the user to check his wirings.
>
> Thank you.
>
> Jan
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev@email-addr-hidden
> http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
-- _______________________________________________ Linux-audio-dev mailing list Linux-audio-dev@email-addr-hidden http://lists.linuxaudio.org/mailman/listinfo/linux-audio-devReceived on Tue Jun 3 00:15:05 2008
This archive was generated by hypermail 2.1.8 : Tue Jun 03 2008 - 00:15:05 EEST