赞
踩
c-ares是异步解析器库,适用于需要无阻塞地执行 DNS 查询或需要并行执行多个 DNS 查询的应用程序。
直接在OpenHarmony-SIG仓中搜索c-ares并下载。
以OpenHarmony 3.1 Beta的rk3568版本为例
将下载的c-ares库代码存在以下路径:./third_party/c-ares
修改添加依赖的编译脚本,路径:/developtools/bytrace_standard/ohos.build
{ "subsystem": "developtools", "parts": { "bytrace_standard": { "module_list": [ "//developtools/bytrace_standard/interfaces/innerkits/native:bytrace_core", "//developtools/bytrace_standard/bin:bytrace_target", "//developtools/bytrace_standard/bin:bytrace.cfg", "//developtools/bytrace_standard/interfaces/kits/js/napi:bytrace", "//third_party/c_ares:c_ares_target" ], "inner_kits": [ { "type": "so", "name": "//developtools/bytrace_standard/interfaces/innerkits/native:bytrace_core", "header": { "header_files": [ "bytrace.h" ], "header_base": "//developtools/bytrace_standard/interfaces/innerkits/native/include" } } ], "test_list": [ "//developtools/bytrace_standard/bin/test:unittest" ] } } }
编译:./build.sh --product-name rk3568 --ccache
生成库文件和一些可执行测试文件,路径:out/rk3568/developtools/profiler
ares_init()
ares_destroy(self.channel)
ares_init_options(&channel, &options, optmask)
ares_set_servers(self.channel, cares.ares_addr_node* c_servers)
dns_callback()
ares_fds()
ares_process()
ares_gethostbyaddr()
支持OpenHarmony API version 8 。
|---- c-ares | |---- ci | |---- docs #资源文件 | |---- include #头文件 | |---- m4 #预处理文件 | |---- src | |---- lib | |---- ares__close_sockets.c #关闭TCP和UDP连接 | |---- ares__get_hostent.c #获取area hostent | |---- ares__read_line.c #将文件中的一行读取到动态分配的缓冲区 | |---- ares__readaddrinfo.c #读取地址信息 | |---- ares__sortaddrinfo.c #对地址进行排序,并重新排列链表 | |---- ares_cancel.c #取消请求 | |---- ares_fds.c #获取使用的FD | |---- ares_search.c #area搜索 | |---- test #单元测试文件 | |---- README.md #安装使用方法
为了能让大家更好的学习鸿蒙(HarmonyOS NEXT)开发技术,这边特意整理了《鸿蒙开发学习手册》(共计890页),希望对大家有所帮助:https://qr21.cn/FV7h05
https://qr21.cn/FV7h05
https://qr21.cn/FV7h05
https://qr21.cn/FV7h05
https://qr18.cn/F781PH
https://qr18.cn/F781PH
1.项目开发必备面试题
2.性能优化方向
3.架构方向
4.鸿蒙开发系统底层方向
5.鸿蒙音视频开发方向
6.鸿蒙车载开发方向
7.鸿蒙南向开发方向
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。