On Mon, 2008-06-02 at 18:13 +0200, [EMAIL PROTECTED] 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 > [email protected] > http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev -- _______________________________________________ Linux-audio-dev mailing list [email protected] http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
