From: Joe E. <jo...@em...> - 2005-05-11 20:50:05
|
Joachim Backhaus wrote: >>Is there a >>way to do this? >> >> >Yes, > >use >Thread.sleep >as you can see in my QuasimidiQuasarSingleDriver. > > Well, I was hoping for something a little better than Thread.sleep. Thread.sleep requires a try/catch block, and it also requires you to wait *longer* than the time needed to transmit, in order to make sure you don't accidentally start the next transmission too soon. Does anybody see any value in a method like: sendAndWait(SysexHandler h, int count, int timeout) where the message would be sent, and wouldn't return until "count" new sysex messages had been received or "timeout" seconds (or milliseconds) had elapsed. If the timeout is reached, an exception would be thrown. - Joe |