首页 > 其他 > 详细

DNS解析

时间:2014-08-05 10:57:59      阅读:426      评论:0      收藏:0      [点我收藏+]

同步API,会阻塞:
getaddrinfo: IPV4 and IPV6, linux依赖<netdb.h>, windows依赖<ws2tcpip.h>
gethostbyname: only IPV4
异步:
libevent
getaddrinfo_a, 会执行注册的callback函数, c-ares库,另起一线程,select/poll类似,监听socket并调用callback

在libcurl里,不会额外开线程,会在libcurl的线程里面不断的poll

10:27:56.326 4382 4382 I AEE/AED : Backtrace:
10:27:56.326 4382 4382 I AEE/AED : #00 pc 00024014 /system/lib/libcurl.tgl.so (query_completed_cb) curl/lib/asyn-ares.c:466
10:27:56.326 4382 4382 I AEE/AED : #01 pc 000022bf /system/lib/libcares.so (end_hquery) cares/src/ares_gethostbyname.c:231
10:27:56.326 4382 4382 I AEE/AED : #02 pc 00006d81 /system/lib/libcares.so (qcallback) cares/src/ares_query.c:180
10:27:56.326 4382 4382 I AEE/AED : #03 pc 000065cb /system/lib/libcares.so (end_query) cares/src/ares_process.c:1266
10:27:56.326 4382 4382 I AEE/AED : #04 pc 000067d3 /system/lib/libcares.so (process_answer) cares/src/ares_process.c:547
10:27:56.326 4382 4382 I AEE/AED : #05 pc 00006a0b /system/lib/libcares.so (processfds) cares/src/ares_process.c:152
10:27:56.326 4382 4382 I AEE/AED : #06 pc 00006ceb /system/lib/libcares.so (ares_process_fd+14) cares/src/ares_process.c:173
10:27:56.326 4382 4382 I AEE/AED : #07 pc 00024113 /system/lib/libcurl.tgl.so (waitperform +xx) curl/lib/asyn-ares.c:296
10:27:56.326 4382 4382 I AEE/AED : #08 pc 0002422f /system/lib/libcurl.tgl.so (Curl_resolver_is_resolved+22)
10:27:56.326 4382 4382 I AEE/AED : #09 pc 0001ff59 /system/lib/libcurl.tgl.so (multi_runsingle+xx)
10:27:56.326 4382 4382 I AEE/AED : #10 pc 000206c3 /system/lib/libcurl.tgl.so (curl_multi_perform+98)

DNS解析,布布扣,bubuko.com

DNS解析

原文:http://www.cnblogs.com/zzSoftware/p/3891630.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!