mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-12 11:17:11 +01:00
fix hermes lite enumeration issues and fix copy paste fail in network library
This commit is contained in:
parent
68bf2fc16f
commit
255988ee46
@ -390,7 +390,7 @@ namespace net {
|
||||
#endif
|
||||
if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, &enable, sizeof(int)) < 0) {
|
||||
closeSocket(s);
|
||||
throw std::runtime_error("Could not configure socket");
|
||||
throw std::runtime_error("Could not enable broadcast on socket");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -205,8 +205,8 @@ namespace hermes {
|
||||
}
|
||||
|
||||
std::vector<Info> discover() {
|
||||
// TODO: Maybe try to instead detect on each interface as a work around for 0.0.0.0 not receiving anything?
|
||||
auto sock = net::openudp("0.0.0.0", 1024);
|
||||
// Open a UDP broadcast socket (TODO: Figure out why 255.255.255.255 doesn't work on windows with local = 0.0.0.0)
|
||||
auto sock = net::openudp("255.255.255.255", 1024, "0.0.0.0", 0, true);
|
||||
|
||||
// Build discovery packet
|
||||
uint8_t discoveryPkt[64];
|
||||
@ -225,6 +225,7 @@ namespace hermes {
|
||||
}
|
||||
}
|
||||
|
||||
// Await all responses
|
||||
std::vector<Info> devices;
|
||||
while (true) {
|
||||
// Wait for a response
|
||||
@ -259,6 +260,8 @@ namespace hermes {
|
||||
devices.push_back(info);
|
||||
}
|
||||
|
||||
// Close broadcast socket
|
||||
sock->close();
|
||||
|
||||
return devices;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user