| 60 | } |
| 61 | |
| 62 | bool network_util::ResolveHostName(const string& host, sockaddr_in *addr) |
| 63 | { |
| 64 | addrinfo hints = {}; |
| 65 | hints.ai_family = AF_INET; |
| 66 | hints.ai_socktype = SOCK_STREAM; |
| 67 | |
| 68 | if (addrinfo *result; !getaddrinfo(host.c_str(), nullptr, &hints, &result)) { |
| 69 | *addr = *reinterpret_cast<sockaddr_in *>(result->ai_addr); //NOSONAR bit_cast is not supported by the bullseye compiler |
| 70 | freeaddrinfo(result); |
| 71 | return true; |
| 72 | } |
| 73 | |
| 74 | return false; |
| 75 | } |
nothing calls this directly
no outgoing calls
no test coverage detected