You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, because the Dns resolver functions return an nb::Result, this means that some higher-level has to actually cache the the hostname being looked up during repeated calls to resolve the name. However, this isn't really a great API because it enforces caching and RAM usage if the hostnames are long. Thus, if an implementation wants to support N simultanenous queries of 255 bytes, it must cache at least 255 * N bytes locally.
Ideally, we would refactor the functions to be get_host_by_name() -> Handle, where Handle is some unique ID that can be queried against in the future (and can ideally be really lightweight, like a u32).
Also, it seems like get_host_by_ip() is a bit of a different DNS use-case and isn't super well-suited for embedded (I just mark it as unimplemented!() in my case because smoltcp doesn't support it). Perhaps it would be best to move this to a separate trait.
The text was updated successfully, but these errors were encountered:
ryan-summers
changed the title
Dns traits enforce caching in-flight DNS requestsDns traits force caching in-flight DNS requests
Aug 22, 2023
Currently, because the
Dns
resolver functions return annb::Result
, this means that some higher-level has to actually cache the the hostname being looked up during repeated calls to resolve the name. However, this isn't really a great API because it enforces caching and RAM usage if the hostnames are long. Thus, if an implementation wants to support N simultanenous queries of 255 bytes, it must cache at least 255 * N bytes locally.Ideally, we would refactor the functions to be
get_host_by_name() -> Handle
, whereHandle
is some unique ID that can be queried against in the future (and can ideally be really lightweight, like au32
).So the API may be:
Also, it seems like
get_host_by_ip()
is a bit of a different DNS use-case and isn't super well-suited for embedded (I just mark it asunimplemented!()
in my case becausesmoltcp
doesn't support it). Perhaps it would be best to move this to a separate trait.The text was updated successfully, but these errors were encountered: