Implements the UDP multicast listener that turns LSL outlet announcements on 239.255.172.215:16571 into stream_info results. More...
#include "lsl_stream_discovery.h"#include <QUdpSocket>#include <QHostAddress>#include <QNetworkDatagram>#include <QElapsedTimer>#include <QDebug>#include <set>
Go to the source code of this file.
Implements the UDP multicast listener that turns LSL outlet announcements on 239.255.172.215:16571 into stream_info results.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
LSLLIB::resolve_streams binds a QUdpSocket on the LSL discovery port 16571 with ShareAddress + ReuseAddressHint so multiple LSLLIB consumers can coexist on the same host, joins the well-known LSL multicast group 239.255.172.215 (skipped on WebAssembly, where the runtime cannot join multicast groups but may still receive broadcast traffic), and then enters a timeout-bounded loop that pulls every pending datagram, parses it via LSLLIB::stream_info::from_string and accumulates the results.
Each accepted descriptor is deduplicated on its per-instance UUID and has its data_host overwritten with the datagram's actual sender address, which is more reliable than the hostname the outlet self-reports (it copes with hosts that have multiple interfaces or that resolve their own name to a loopback address). LSLLIB::resolve_stream is implemented as a thin client-side filter on top: it calls LSLLIB::resolve_streams once and then matches the requested property locally, which keeps the network-facing surface to a single well-tested code path.
Definition in file lsl_stream_discovery.cpp.