![]() |
Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
|
Implements host auto-discovery helpers. More...
#include "src/network/host_discovery.h"#include <algorithm>#include <cctype>#include <cstdint>#include <mutex>#include <string>#include <string_view>#include <unordered_map>#include <utility>#include <vector>#include "src/app/host_records.h"#include "src/logging/logger.h"#include "src/network/runtime_network.h"#include <cstddef>#include <lwip/apps/mdns.h>#include <lwip/apps/mdns_domain.h>#include <lwip/err.h>#include <lwip/igmp.h>#include <lwip/netif.h>#include <lwip/prot/dns.h>#include <lwip/tcpip.h>#include <windows.h>Functions | |
| bool | network::testing::append_mdns_discovered_host (DiscoverHostsResult *result, std::string displayName, const std::string &address, uint16_t port) |
| Expose host normalization and deduplication to host-native unit tests. | |
| void | network::testing::clear_host_discovery_test_handler () |
| Remove any scripted host-discovery handler installed for tests. | |
| DiscoverHostsResult | network::discover_hosts (uint32_t timeoutMilliseconds) |
| Discover Moonlight-compatible hosts on the local network. | |
| std::string | network::testing::first_host_discovery_label (std::string_view domainText) |
| Expose the internal DNS-label parser to host-native unit tests. | |
| void | network::testing::set_host_discovery_test_handler (HostDiscoveryTestHandler handler) |
| Install a scripted host-discovery handler for unit tests. | |
| void | network::testing::sort_discovered_hosts (std::vector< DiscoveredHost > *hosts) |
| Expose the runtime host ordering rules to host-native unit tests. | |
| std::string | network::testing::trim_host_discovery_text (std::string_view text) |
| Expose the internal whitespace trimmer to host-native unit tests. | |
Variables | |
| struct netif * | g_pnetif |
| nxdk-provided pointer to the active lwIP network interface. | |
Implements host auto-discovery helpers.
| bool network::testing::append_mdns_discovered_host | ( | DiscoverHostsResult * | result, |
| std::string | displayName, | ||
| const std::string & | address, | ||
| uint16_t | port ) |
Expose host normalization and deduplication to host-native unit tests.
| result | Discovery result to update. |
| displayName | Candidate user-facing label. |
| address | Candidate IPv4 address. |
| port | Candidate HTTP port, or zero for the default port. |
| DiscoverHostsResult network::discover_hosts | ( | uint32_t | timeoutMilliseconds | ) |
Discover Moonlight-compatible hosts on the local network.
The Xbox build uses lwIP mDNS/DNS-SD search support to look for compatible GameStream services. Host-native test builds return scripted results when a test handler is installed, or an empty successful result otherwise.
| timeoutMilliseconds | Maximum discovery window in milliseconds. |
| std::string network::testing::first_host_discovery_label | ( | std::string_view | domainText | ) |
Expose the internal DNS-label parser to host-native unit tests.
| domainText | Service instance or host domain text. |
| void network::testing::set_host_discovery_test_handler | ( | HostDiscoveryTestHandler | handler | ) |
Install a scripted host-discovery handler for unit tests.
| handler | Callback that should service subsequent discovery requests. |
| void network::testing::sort_discovered_hosts | ( | std::vector< DiscoveredHost > * | hosts | ) |
Expose the runtime host ordering rules to host-native unit tests.
| hosts | Hosts to sort in place. |
| std::string network::testing::trim_host_discovery_text | ( | std::string_view | text | ) |
Expose the internal whitespace trimmer to host-native unit tests.
| text | Raw discovery text. |