V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
lxk11153
V2EX  ›  Java

InetSocketAddress Resolved/Unresolved 对后续使用上有啥区别吗?

  •  
  •   lxk11153 · Jul 28, 2020 · 1467 views
    This topic created in 2109 days ago, the information mentioned may be changed or developed.
    • java.net.InetSocketAddress#createUnresolved(String, int)
    • java.net.InetSocketAddress#InetSocketAddress(String, int)
      • 包含了域名转 IP 这一步,意思是后续需要用到 ip 地址的地方就不需要每个地方自行转换了?
    Supplement 1  ·  Oct 1, 2020

    This class implements an IP Socket Address (IP address + port number) It can also be a pair (hostname + port number), in which case an attempt will be made to resolve the hostname. If resolution fails then the address is said to be unresolved but can still be used on some circumstances like connecting through a proxy.

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4960 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 09:54 · PVG 17:54 · LAX 02:54 · JFK 05:54
    ♥ Do have faith in what you're doing.