AsyncFw 1.2
Async Framework is c++ runtime with timers, poll notifiers, sockets, coroutines, etc.
 
Loading...
Searching...
No Matches
AddressInfo.h
1/*
2Copyright (c) 2026 Alexandr Kuzmuk
3
4This file is part of the AsyncFw project. Licensed under the MIT License.
5See {Link: LICENSE file https://mit-license.org} in the project root for full license information.
6*/
7
8#pragma once
9
10#include <string>
11#include "../core/FunctionConnector.h"
12#include "Coroutine.h"
13
14#ifndef _WIN32
15 #define AF_UNSPEC_ 0
16 #define AF_INET_ 2
17 #define AF_INET6_ 10
18#else
19 #define AF_UNSPEC_ 0
20 #define AF_INET_ 2
21 #define AF_INET6_ 23
22#endif
23
24namespace AsyncFw {
29class AddressInfo {
30 struct Private;
31
32public:
33 using Result = std::vector<std::string>;
34 enum Family : uint8_t { Unspec = AF_UNSPEC_, Inet = AF_INET_, Inet6 = AF_INET6_ };
35 AddressInfo();
36 ~AddressInfo();
37
38 void resolve(const std::string &, Family = Inet);
39 void setTimeout(int);
40
42 FunctionConnectorProtected<AddressInfo>::Connector<int, const std::vector<std::string> &> completed;
44 AsyncFw::CoroutineAwait coResolve(const std::string &, Family = Inet);
45
46private:
47 struct Private *private_;
48};
49} // namespace AsyncFw
AsyncFw::CoroutineAwait coResolve(const std::string &, Family=Inet)
The AddressInfo::coResolve coroutine awaiter.
Definition AddressInfo.cpp:122
FunctionConnectorProtected< AddressInfo >::Connector< int, const std::vector< std::string > & > completed
The AddressInfo::completed connector.
Definition AddressInfo.h:42
The CoroutineAwait struct.
Definition Coroutine.h:51