V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lxk11153
V2EX  ›  Java

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

  •  
  •   lxk11153 · 2020-07-28 00:46:05 +08:00 · 1044 次点击
    这是一个创建于 1405 天前的主题,其中的信息可能已经有所发展或是发生改变。
    • java.net.InetSocketAddress#createUnresolved(String, int)
    • java.net.InetSocketAddress#InetSocketAddress(String, int)
      • 包含了域名转 IP 这一步,意思是后续需要用到 ip 地址的地方就不需要每个地方自行转换了?
    第 1 条附言  ·  2020-10-01 10:44:58 +08:00

    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.

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   950 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 20:05 · PVG 04:05 · LAX 13:05 · JFK 16:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.