Performs low-level HTTP discovery and JSON parsing. More...
Header: | #include <DiscoveryCore> |
Inherits: | QObject |
DiscoveryCore(QObject *parent = nullptr) | |
void | fetchServerMeta(const QUrl &url) |
DiscoveryCore is responsible for making an HTTP GET request to a chat server's discovery endpoint, parsing the JSON response into a DiscoveryPayload, and emitting the result via signals. Only one request is active at any time; repeated calls cancel the previous one.
These members are maintained internally by DiscoveryCore
and are not intended for external use. They are documented here for developer clarity.
Private Variables
m_accessManager (QNetworkAccessManager)
– Handles asynchronous HTTP requests for discovery.m_currentReply (QNetworkReply*)
– Tracks the active network request so it can be canceled or cleared.Internal Functions
handleReply()
– Processes the HTTP response and emits either a success or error signal.clearCurrentReply()
– Resets and cleans up the current network reply.See also DiscoveryPayload and DiscoveryPage.
[explicit]
DiscoveryCore::DiscoveryCore(QObject *parent = nullptr)Constructs the DiscoveryCore.
parent is the optional parent object for ownership and signal propagation.
Initiates a discovery request to the given url.
Cancels any previous request in progress. Emits success with a parsed DiscoveryPayload on success or error with a descriptive message on failure.
See also DiscoveryPayload.