c-ares

Building grpc from source using preinstalled packages

时光毁灭记忆、已成空白 提交于 2020-12-15 05:47:21
问题 I'm trying to integrate gRPC in existing project. It already has directory containing all gRPC's dependencies installed (ssl, c-ares, protobuf and zlib). I want to use them while building gRPC, and install gRPC into the same directory. I downloaded gRPC archive (without cloning submodules located in grpc/third_party/), and tried to generate build system for building and installing gRPC into my destination folder (using cmake). I used following command: cmake -DCMAKE_INSTALL_PREFIX=$PREFIX

how to build c-ares library in android (NDK)

我们两清 提交于 2019-12-31 22:28:35
问题 Can anyone please tell me how to build C-ares library in android (ndk-build) 回答1: Here's how to build it as a static library for ARMv7 with the NDK standalone toolchain: export NDK=/tmp/android-ndk-r8b # Create the standalone toolchain $NDK/build/tools/make-standalone-toolchain.sh \ --platform=android-9 \ --install-dir=/tmp/my-android-toolchain export PATH=/tmp/my-android-toolchain/bin:$PATH export SYSROOT=/tmp/my-android-toolchain/sysroot export CC="arm-linux-androideabi-gcc --sysroot

c-ares specifying network interface for the DNS resolves

自闭症网瘾萝莉.ら 提交于 2019-12-20 04:29:12
问题 Is there a way in which you can set the network interface to which the DNS requests can be bound to. We have a project which requires to use a highpriority streaming session go through one interface and all the other requests channeled through the second one. example: setting 'eth0' so that all the ares requests will go through 'eth0' and not on 'wlan0'. I was not able to find any API in c-ares (in ares_init_options() API) that gives this option of setting interface. Can you please let me

How do I resolve an IP into host using c-ares?

此生再无相见时 提交于 2019-11-30 13:55:42
This is what I've done so far. It compiles, but it segfaults when I try to run it. #include <iostream> #include <netdb.h> #include <arpa/inet.h> #include <ares.h> void dns_callback (void* arg, int status, int timeouts, struct hostent* host) { std::cout << host->h_name << "\n"; } int main(int argc, char **argv) { struct in_addr ip; char *arg; inet_aton(argv[1], &ip); ares_channel channel; ares_gethostbyaddr(channel, &ip, 4, AF_INET, dns_callback, arg); sleep(15); return 0; } You atleast have to initialize the ares_channel before you use it if(ares_init(&channel) != ARES_SUCCESS) { //handle

How do I resolve an IP into host using c-ares?

北战南征 提交于 2019-11-29 19:28:12
问题 This is what I've done so far. It compiles, but it segfaults when I try to run it. #include <iostream> #include <netdb.h> #include <arpa/inet.h> #include <ares.h> void dns_callback (void* arg, int status, int timeouts, struct hostent* host) { std::cout << host->h_name << "\n"; } int main(int argc, char **argv) { struct in_addr ip; char *arg; inet_aton(argv[1], &ip); ares_channel channel; ares_gethostbyaddr(channel, &ip, 4, AF_INET, dns_callback, arg); sleep(15); return 0; } 回答1: You atleast

how enable curl's AsynchDNS?

早过忘川 提交于 2019-11-28 04:34:11
问题 I want enable curl's AsynchDNS ( find in phpinfo() ) . What do i must do ? This is screenshot : I found out install http://c-ares.haxx.se/ c-ares is a C library that performs DNS requests and name resolves asynchronously http://curl.haxx.se/dev/readme-ares.html But i still stuck at how install on curl exist. 回答1: libcurl needs to have been compiled and built for it. For Linux and other *nix systems, you can build with c-ares or the threaded-resolver to make it use asynchronous resolves. 来源: