title: C++ asynchronous hostname resolving
body: <p>I have a epoll server which sometimes opens outgoing connections, using their hostnames representation. Because of high rate of incoming connections flow, I don't want to block somewhere like <code>getaddrinfo()</code> or <code>gethostbyname()</code>.  Sure, I could implement a cache plus a new thread, where the hostname resolution would be performed. Is there a single-threaded non-blocking way to resolve a hostname to an IP?</p>