【发布时间】:2019-05-01 14:21:05
【问题描述】:
当我尝试在端口 0 (linux 5.0) 上 bind(2) 时会发生什么?
使用 BSD nc:nc -l 0 有效,并且跟踪它给了我:
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(3, 1) = 0
accept4(3,
但正在尝试连接:
$ nc 127.1 0
nc: port number too small: 0
这里发生了什么?
【问题讨论】:
标签: linux unix networking