BcastListener: Guard start() w/spinlock for races

This commit is contained in:
2025-11-07 21:12:05 -04:00
parent 887fa1ab6f
commit e0c0976e0b
@@ -133,10 +133,15 @@ void BroadcastListener::start(void)
* We should also set up a timer to check for devices that have gone
* away.
*/
{
smo::SpinLock::Guard lock(isListeningLock);
socket.open(boost::asio::ip::udp::v4());
socket.bind(listeningEndpoint);
isListening = true;
}
// Start the first async receive operation
startReceive();
std::cout << __func__ << ": BroadcastListener started on port "