Closed
Description
TCP/UDP listeners and streams take A: std::net::ToSocketAddrs
. Some ToSocketAddrs
impls will resolve domain names. However, ToSocketAddrs
is not futures-aware, so DNS lookups are synchronous.
Possible solutions:
- Spawn a blocking task a la filesystem operations (simpler)
- Replace
ToSocketAddrs
with an async version (probably more efficient)