Non-blocking (async) DNS resolving in Java

前端 未结 6 596
一生所求
一生所求 2021-02-05 02:30

Is there a clean way to resolve a DNS query (get IP by hostname) in Java asynchronously, in non-blocking way (i.e. state machine, not 1 query = 1 thread - I\'d like to run tens

6条回答
  •  忘了有多久
    2021-02-05 03:05

    Linux has an asynchronous DNS lookup function: http://www.imperialviolet.org/2005/06/01/asynchronous-dns-lookups-with-glibc.html

    If you are on Linux you just need to wrap that up in some JNI.

提交回复
热议问题