Moonlight-XboxOG latest
Moonlight Xbox OG is a port of the Moonlight Game Streaming client to the original Xbox console.
host_discovery.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <cstdint>
9#include <functional>
10#include <string>
11#include <vector>
12
13namespace network {
14
19 std::string displayName;
20 std::string address;
21 uint16_t port = 0;
22 };
23
28 std::vector<DiscoveredHost> hosts;
29 std::string errorMessage;
30 };
31
42 DiscoverHostsResult discover_hosts(uint32_t timeoutMilliseconds);
43
44 namespace testing {
45
49 using HostDiscoveryTestHandler = std::function<DiscoverHostsResult(uint32_t timeoutMilliseconds)>;
50
57
62
63 } // namespace testing
64
65} // namespace network
DiscoverHostsResult discover_hosts(uint32_t timeoutMilliseconds)
Discover Moonlight-compatible hosts on the local network.
Definition host_discovery.cpp:428
void set_host_discovery_test_handler(HostDiscoveryTestHandler handler)
Install a scripted host-discovery handler for unit tests.
Definition host_discovery.cpp:477
void clear_host_discovery_test_handler()
Remove any scripted host-discovery handler installed for tests.
Definition host_discovery.cpp:481
std::function< DiscoverHostsResult(uint32_t timeoutMilliseconds)> HostDiscoveryTestHandler
Callback used by unit tests to replace runtime host discovery.
Definition host_discovery.h:49
Result of one host auto-discovery sweep.
Definition host_discovery.h:27
std::string errorMessage
Non-empty when discovery could not run successfully.
Definition host_discovery.h:29
std::vector< DiscoveredHost > hosts
Hosts discovered during the sweep.
Definition host_discovery.h:28
One Moonlight-compatible host discovered through mDNS/DNS-SD.
Definition host_discovery.h:18
uint16_t port
Host HTTP port advertised by the discovered service.
Definition host_discovery.h:21
std::string address
Canonical IPv4 address resolved for the host.
Definition host_discovery.h:20
std::string displayName
User-facing host name discovered from the service instance.
Definition host_discovery.h:19