Unix 套接字:AF_LOCAL 与 AF_INET [英] Unix Sockets : AF_LOCAL vs AF_INET

查看:87
本文介绍了Unix 套接字:AF_LOCAL 与 AF_INET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始在 UNIX 中进行套接字编程,我正在阅读套接字系统调用的手册页.我对 AF_LOCAL 参数及其使用时间有些困惑.手册只说本地通信.AF_INET 格式不能用于本地通信吗?

I'm just starting with socket programming in UNIX and I was reading the man pages for the socket system call. I'm a bit confused about the AF_LOCAL argument and when it is used. The manual just says local communication. Wouldn't an AF_INET format also work for local communication?

推荐答案

AF_LOCAL 使用文件系统本地的 UNIX 域套接字,可用于内部通信.AF_INET 是一个 IP 套接字.AF_LOCAL 不会因通过 IP 发送数据而导致一些性能损失.请参阅该主题的古老但非常好的讨论.

AF_LOCAL uses UNIX domain sockets which are local to the filesystem and can be used for internal communications. AF_INET is an IP socket. AF_LOCAL will not incur some performance penalties related to sending data over IP. See this old but very nice discussion of the topic.

这篇关于Unix 套接字:AF_LOCAL 与 AF_INET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆