MCPcopy Create free account
hub / github.com/apache/arrow / GetAddressInfo

Method GetAddressInfo

cpp/src/arrow/flight/sql/odbc/odbc_impl/address_info.cc:23–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21namespace driver {
22
23bool AddressInfo::GetAddressInfo(const std::string& host, char* host_name_info,
24 int64_t max_host) {
25 if (addrinfo_result_) {
26 freeaddrinfo(addrinfo_result_);
27 addrinfo_result_ = nullptr;
28 }
29
30 int error;
31 error = getaddrinfo(host.c_str(), NULL, NULL, &addrinfo_result_);
32
33 if (error != 0) {
34 return false;
35 }
36
37 error = getnameinfo(addrinfo_result_->ai_addr, addrinfo_result_->ai_addrlen,
38 host_name_info, static_cast<uint32_t>(max_host), NULL, 0, 0);
39 return error == 0;
40}
41
42AddressInfo::~AddressInfo() {
43 if (addrinfo_result_) {

Callers 1

BuildLocationMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected