Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns解析支持毫秒级超时设置吗 #304

Open
climber119 opened this issue Mar 27, 2023 · 3 comments
Open

dns解析支持毫秒级超时设置吗 #304

climber119 opened this issue Mar 27, 2023 · 3 comments

Comments

@climber119
Copy link

目前看不管是使用udp还是tcp ACL_RES中的rs_timeout 时间单位都是秒 然后在socket读写时 在*1000 转换为毫秒 ,这么设计是因为DNS不需要设置太精细的超时控制吗 c-ares 是可以设置毫秒级别的超时控制及重试次数,请问下,acl 有考虑把时间精度调高吗?

还有 如果直接通过acl_gethostbyname 来进行解析的时候,不能单独设置某个域名的超时时间,只能通过acl_res_set_timeout 设置全局的超时时间吗

@zhengshuxin
Copy link
Member

这应该是历史原因,最早Acl的IO读写超时的单位为秒,后来因为项目需要将IO读写的超时单位精确到毫秒,象 acl_res 模块还是延用最早的超时单位精度,也可以根据需要精确到毫秒。

@climber119
Copy link
Author

这应该是历史原因,最早Acl的IO读写超时的单位为秒,后来因为项目需要将IO读写的超时单位精确到毫秒,象 acl_res 模块还是延用最早的超时单位精度,也可以根据需要精确到毫秒。

这里会在后续版本考虑 在udp_res_lookup 直接使用acl_read_wait_ms 吗 ,还有若直接使用acl_gethostbyname 也是无法对单个域名进行超时设置的,目前的超时设置只能针对所有域名 除非使用知道nameserver 来acl_res_new 的方式创建并设置超时时间

@zhengshuxin
Copy link
Member

将来可以增加毫秒级别的超时功能。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants