userver: userver/net/blocking/get_addr_info.hpp Source File
Loading...
Searching...
No Matches
get_addr_info.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/net/blocking/get_addr_info.hpp
4/// @brief Blocking Functions for getaddrinfo
5
6#include <vector>
7
8#include <userver/engine/io/sockaddr.hpp>
9
10USERVER_NAMESPACE_BEGIN
11
12namespace net::blocking {
13
14/// @brief Resolve host and port via blocking syscall.
15/// @note It is recommended to use clients::dns::Resolver if possible
16/// @param host - hostname (or IP) to resolve
17/// @param service_and_port - if this argument is a service name, it is
18/// translated to the corresponding port number, otherwise treated as port
19/// number.
20std::vector<engine::io::Sockaddr> GetAddrInfo(std::string_view host,
21 const char* service_or_port);
22
23} // namespace net::blocking
24
25USERVER_NAMESPACE_END