3 Discovery::Discovery():
4 broadcast_addr("ff02::1"),
7 socket.bind(QHostAddress::AnyIPv6);
8 connect(&socket, &QIODevice::readyRead, this, &Discovery::datagram_available);
10 connect(&timer, &QTimer::timeout, this, &Discovery::send_beacon);
11 timer.setInterval(5000);
14 void Discovery::start()
20 void Discovery::stop()
25 void Discovery::send_beacon()
27 socket.writeDatagram("xinema", 6, broadcast_addr, port);
30 void Discovery::datagram_available()
33 QHostAddress peer_addr;
34 socket.readDatagram(rbuf, sizeof(rbuf), &peer_addr, 0);
36 emit server_discovered(peer_addr);