namespace webrtc { // This file contains a default implementation of // AsyncDnsResolverInterface, for use when there is no need for special // treatment.
class AsyncDnsResolverResultImpl : public AsyncDnsResolverResult { public: bool GetResolvedAddress(int family, SocketAddress* addr) const override; // Returns error from resolver. int GetError() const override;
class RTC_EXPORT AsyncDnsResolver : public AsyncDnsResolverInterface { public:
AsyncDnsResolver();
~AsyncDnsResolver() override; // Start address resolution of the hostname in `addr`. void Start(const SocketAddress& addr,
absl::AnyInvocable<void()> callback) override; // Start address resolution of the hostname in `addr` matching `family`. void Start(const SocketAddress& addr, int family,
absl::AnyInvocable<void()> callback) override; const AsyncDnsResolverResult& result() const override;
private: class StateImpl; using State = FinalRefCountedObject<StateImpl>;
scoped_refptr<State> state_; // To check for the target task queue going away
AsyncDnsResolverResultImpl result_;
absl::AnyInvocable<void() &&> callback_; #ifdefined(WEBRTC_WIN)
OVERLAPPED ol_ = {};
HANDLE cancel_ = nullptr;
PADDRINFOEXW addr_info_ = nullptr;
PlatformThread worker_; #endif
ScopedTaskSafety safety_; // To check for client going away. Must be last.
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.