zungmou
V2EX  ›  问与答

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

  •  
  •   zungmou · Oct 11, 2016 · 6720 views
    This topic created in 3676 days ago, the information mentioned may be changed or developed.
    例如 114.114.114.114:53 这种形式,该怎么称呼?
    24 replies  •  2016-10-11 18:51:47 +08:00
    wyntergreg
    wyntergreg
    Oct 11, 2016
    1
    艾屁冒号炮特
    calease
    calease
    Oct 11, 2016❤️1
    2
    socket
    lrh3321
    lrh3321
    Oct 11, 2016
    3
    IPEndPoint
    bugmenein
    bugmenein
    Oct 11, 2016
    4
    不如直接提整个 URI ( https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)?
    scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
    zungmou
    zungmou
    OP
    Oct 11, 2016
    5
    @calease 这叫 socket?
    @lrh3321 这个好像是 .net 的称呼。
    @bugmenein 没看懂!
    airqj
    airqj
    Oct 11, 2016
    6
    服务
    onlyice
    onlyice
    Oct 11, 2016
    7
    endpoint
    shlabc
    shlabc
    Oct 11, 2016
    8
    hostmame+port=host
    xderam
    xderam
    Oct 11, 2016
    9
    二元组?
    shoaly
    shoaly
    Oct 11, 2016
    10
    endpoint+1
    timothyqiu
    timothyqiu
    Oct 11, 2016❤️1
    11
    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
    sutra
    Oct 11, 2016
    12
    套接字

    哈哈哈,这个翻译很强大。
    miaoever
    miaoever
    Oct 11, 2016
    13
    socket
    zungmou
    zungmou
    OP
    Oct 11, 2016
    14
    @timothyqiu 虽然可以叫 soket, 但是感觉没有人会在代码里这样命名吧?
    shiji
    shiji
    Oct 11, 2016
    15
    socket address
    shiji
    shiji
    Oct 11, 2016
    16
    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.
    run2
    run2
    Oct 11, 2016
    17
    URI 和 socket 都是特定使用的场景的叫法,叫法也只有按场景来吧
    bigpigeon
    bigpigeon
    Oct 11, 2016
    18
    tcp/ip
    qfdk
    qfdk
    PRO
    Oct 11, 2016 via iPhone
    19
    代理
    zungmou
    zungmou
    OP
    Oct 11, 2016
    20
    @shiji Thank you very much, 我就问一句,遇到类似的情况,你在代码里是如何命名的?
    Tink
    Tink
    Oct 11, 2016 via iPhone
    21
    proxy
    jsq2627
    jsq2627
    PRO
    Oct 11, 2016 via iPhone
    22
    @zungmou 尽管是.net 的称呼但我觉得 endpoint 确实是很合适的名字~
    sutra
    sutra
    Oct 11, 2016
    23
    let アドレス = "114.114.114.114:53"
    sutra
    sutra
    Oct 11, 2016
    24
    不过这个实例里是个 DNS 地址嘛。

    所以就 let dnsServerAddress = "114.114.114.114:53"
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2903 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 69ms · UTC 12:25 · PVG 20:25 · LAX 04:25 · JFK 07:25
    ♥ Do have faith in what you're doing.