什么是地址族?
当我阅读套接字编程时,我了解到 AF_ 代表地址族。但从字面上看,一个家庭应该有很多成员。那么,AF_INET 地址族有哪些成员呢?
在我看来,我认为说“地址类型”比“地址家庭”更合适。这也适用于 PF(协议族)。
谢谢。
When I read about socket programming, I get to know that AF_ stands for Address Family. But literally, a family should have many members. So, what are the members of, say, AF_INET address family?
In my opinion, I think it would be more appropriate to say Address Type than Addresss Family. Also this applies to PF (Protocol Family).
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
AF_INET
地址族的成员是 IPv4 地址。AF_INET6
地址族的成员是 IPv6 地址。AF_UNIX 地址族的成员是 Unix 域套接字的名称(例如 /var/run/mysqld/mysqld.sock )。
AF_IPX
地址族的成员是 IPX 地址,依此类推。我认为您真的不需要在这里区分家庭和类型。这些只是同义词;除了“family”看起来更专业,非常适合此目的,而“type”则负担过重,过于笼统。
最终,这是一个约定。有太多的文献使用“地址族”,以至于它已经成为一个行之有效的术语,即使不是人类的一生,也已经有几十年的历史了。
Members of
AF_INET
address family are IPv4 addresses.Members of
AF_INET6
address family are IPv6 addresses.Members of
AF_UNIX
address family are names of Unix domain sockets (/var/run/mysqld/mysqld.sock
is an example).Members of
AF_IPX
address family are IPX addresses, and so on.I don't think you really need to distinguish between family and type here. These are merely synonyms; except that family looks more specialized, well-suited for this purpose, whilst type is much overloaded, way too general word.
Ultimately, it's a convention. There's just so much literature using "address family" that it's well-established terminology, by decades if not human lifetimes.