* @brief Applies the optional --udp-remote spec to the active network driver. */
| 516 | * @brief Applies the optional --udp-remote spec to the active network driver. |
| 517 | */ |
| 518 | static void applyUdpRemote(const QString& udpRemote) |
| 519 | { |
| 520 | const QStringList parts = udpRemote.split(':'); |
| 521 | if (parts.size() != 2) { |
| 522 | qWarning() << "Invalid UDP address format. Expected: host:port"; |
| 523 | return; |
| 524 | } |
| 525 | |
| 526 | bool ok = false; |
| 527 | const quint16 remotePort = parts[1].toUInt(&ok); |
| 528 | if (!ok || remotePort == 0) { |
| 529 | qWarning() << "Invalid UDP remote port:" << parts[1]; |
| 530 | return; |
| 531 | } |
| 532 | |
| 533 | IO::ConnectionManager::instance().network()->setRemoteAddress(parts[0]); |
| 534 | IO::ConnectionManager::instance().network()->setUdpRemotePort(remotePort); |
| 535 | } |
| 536 | |
| 537 | /** |
| 538 | * @brief Configures and connects a UDP socket from CLI options. |
no test coverage detected