mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-25 12:07:49 +02:00
add fobossdr_source module and fix network sink crash when the given hostname is invalid
This commit is contained in:
@ -217,14 +217,19 @@ private:
|
||||
}
|
||||
|
||||
void startServer() {
|
||||
if (modeId == SINK_MODE_TCP) {
|
||||
listener = net::listen(hostname, port);
|
||||
if (listener) {
|
||||
listener->acceptAsync(clientHandler, this);
|
||||
try {
|
||||
if (modeId == SINK_MODE_TCP) {
|
||||
listener = net::listen(hostname, port);
|
||||
if (listener) {
|
||||
listener->acceptAsync(clientHandler, this);
|
||||
}
|
||||
}
|
||||
else {
|
||||
conn = net::openUDP("0.0.0.0", port, hostname, port, false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
conn = net::openUDP("0.0.0.0", port, hostname, port, false);
|
||||
catch (const std::exception& e) {
|
||||
flog::error("Failed to open socket: {}", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user