mit - 需要c/c++的开源dns解析库,有推荐的吗?
PHPz
PHPz 2017-04-17 11:19:03
0
3
466

在android端,调用底层的gethostbyname解析域名在有些手机上会存在一些问题(我遇到的问题和这里类似),需要寻找一个开源的dns解析库。除了c-ares(采用MIT协议)外,还是其它的可推荐吗?adns采用了GPL协议,不能使用。

在c/c++层采用回调的方式调用java层的接口好像可以解决这个问题,但对这块不是很熟悉,操作起来比较困难。

对于这个问题,各位朋友是否有一些其它好的建议,望赐教!

PHPz
PHPz

学习是最好的投资!

reply all(3)
刘奇

I have never done dns resolution on android.

Provide an alternative idea: make a resolution proxy on your own server, and the client will send the domain name to be resolved.

Or use jni to call the Java layer implementation in android.

刘奇

I used tadns and the BEER-WARE protocol in my C project, which is friendlier than MIT
Use asynchronous callback
To use it on android, you need to use jni

黄舟

But refer to libevent, which has the function of dns resolution, and it is asynchronous, which is very easy to use. On Android, I made some modifications to libevent to make it work properly. Please refer to my article "An improvement of libevent on Android"

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!