Dear JUCE team,
thanks for the new OSC feature, very useful!
While testing it I realized the OSCReceiver thread fills up pretty much all of a CPU core because it constantly tries to read data from the socket, even though no new data arrived.
I don't know wheter the following is the right approach to fix it, but adding a socket->waitUntilReady(true, 1000) in juce_OSCReceiver.cpp does the job for me.
Best, Matthias
void run() override
{
while (! threadShouldExit())
{
jassert (socket != nullptr);
char buffer[oscBufferSize];
socket->waitUntilReady (true, 1000);
const int bytesRead = socket->read (buffer, (int) sizeof (buffer), false);
if (bytesRead >= 4)
handleBuffer (buffer, bytesRead);
}
}
