V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zungmou
V2EX  ›  问与答

IP:Port 这种形式有统一的叫法吗?

  •  
  •   zungmou · 2016-10-11 10:29:31 +08:00 · 5193 次点击
    这是一个创建于 2725 天前的主题,其中的信息可能已经有所发展或是发生改变。
    例如 114.114.114.114:53 这种形式,该怎么称呼?
    24 条回复    2016-10-11 18:51:47 +08:00
    wyntergreg
        1
    wyntergreg  
       2016-10-11 10:34:06 +08:00
    艾屁冒号炮特
    calease
        2
    calease  
       2016-10-11 10:37:41 +08:00   ❤️ 1
    socket
    lrh3321
        3
    lrh3321  
       2016-10-11 10:40:17 +08:00
    IPEndPoint
    bugmenein
        4
    bugmenein  
       2016-10-11 10:41:25 +08:00
    不如直接提整个 URI ( https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)?
    scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
    zungmou
        5
    zungmou  
    OP
       2016-10-11 10:46:40 +08:00
    @calease 这叫 socket?
    @lrh3321 这个好像是 .net 的称呼。
    @bugmenein 没看懂!
    airqj
        6
    airqj  
       2016-10-11 10:48:42 +08:00
    服务
    onlyice
        7
    onlyice  
       2016-10-11 10:48:45 +08:00
    endpoint
    shlabc
        8
    shlabc  
       2016-10-11 10:49:03 +08:00
    hostmame+port=host
    xderam
        9
    xderam  
       2016-10-11 10:53:47 +08:00
    二元组?
    shoaly
        10
    shoaly  
       2016-10-11 10:57:51 +08:00
    endpoint+1
    timothyqiu
        11
    timothyqiu  
       2016-10-11 11:06:15 +08:00   ❤️ 1
    socket

    根据 RFC 793 ( TCP ):
    > To allow for many processes within a single Host to use TCP communication facilities simultaneously, the TCP provides a set of addresses or ports within each host. Concatenated with the network and host addresses from the internet communication layer, this forms a socket.
    sutra
        12
    sutra  
       2016-10-11 11:42:49 +08:00
    套接字

    哈哈哈,这个翻译很强大。
    miaoever
        13
    miaoever  
       2016-10-11 11:52:13 +08:00
    socket
    zungmou
        14
    zungmou  
    OP
       2016-10-11 13:41:51 +08:00
    @timothyqiu 虽然可以叫 soket, 但是感觉没有人会在代码里这样命名吧?
    shiji
        15
    shiji  
       2016-10-11 13:45:32 +08:00
    socket address
    shiji
        16
    shiji  
       2016-10-11 13:52:59 +08:00
    socket address 的具体理由:

    参见:
    https://docs.oracle.com/javase/7/docs/api/java/net/InetSocketAddress.html

    https://docs.python.org/2/library/socket.html

    Socket addresses are represented as follows: A single string is used for the AF_UNIX address family. A pair (host, port) is used for the AF_INET address family, where host is a string representing either a hostname in Internet domain notation like 'daring.cwi.nl' or an IPv4 address like '100.50.200.5', and port is an integer.
    sobigfish
        17
    sobigfish  
       2016-10-11 14:17:38 +08:00
    URI 和 socket 都是特定使用的场景的叫法,叫法也只有按场景来吧
    bigpigeon
        18
    bigpigeon  
       2016-10-11 14:30:03 +08:00
    tcp/ip
    qfdk
        19
    qfdk  
       2016-10-11 14:49:29 +08:00 via iPhone
    代理
    zungmou
        20
    zungmou  
    OP
       2016-10-11 14:57:46 +08:00
    @shiji Thank you very much, 我就问一句,遇到类似的情况,你在代码里是如何命名的?
    Tink
        21
    Tink  
       2016-10-11 15:09:53 +08:00 via iPhone
    proxy
    jsq2627
        22
    jsq2627  
       2016-10-11 18:31:31 +08:00 via iPhone
    @zungmou 尽管是.net 的称呼但我觉得 endpoint 确实是很合适的名字~
    sutra
        23
    sutra  
       2016-10-11 18:50:57 +08:00
    let アドレス = "114.114.114.114:53"
    sutra
        24
    sutra  
       2016-10-11 18:51:47 +08:00
    不过这个实例里是个 DNS 地址嘛。

    所以就 let dnsServerAddress = "114.114.114.114:53"
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4685 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 10:02 · PVG 18:02 · LAX 03:02 · JFK 06:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.