UNIX domain sockets

A UNIX socket is an inter-process communication mechanism that allows bidirectional data exchange between processes running on the same machine.

IP sockets (especially TCP/IP sockets) are a mechanism allowing communication between processes over the network.

In some cases, you can use TCP/IP sockets to talk with processes running on the same computer (by using the loopback interface).

UNIX domain sockets know that they're executing on the same system, so they can avoid some checks and operations (like routing);

which makes them faster and lighter than IP sockets.

So if you plan to communicate with processes on the same host, this is a better option than IP sockets.

相关推荐
Marst Code20 分钟前
(Unix)pipe 把程序当成可组合的函数
服务器·unix
CHHH_HHH25 分钟前
【Linux网络篇】初识网络与Socket编程基础
linux·服务器·c语言·开发语言·网络·后端·1024程序员节
星恒随风1 小时前
Linux线程同步与互斥:彻底理解读者写者问题、读写锁原理、读者优先与写者优先(附pthread完整实验)
linux·服务器·笔记·1024程序员节
_upupup1 小时前
Linux中的进程
linux·服务器·1024程序员节
虚无的纽扣2 小时前
【Linux】线程同步:条件不满足时,线程该怎么等
linux·服务器·1024程序员节
Ruiery2 小时前
Linux 6.6内核并发与同步(一):原子操作与内存屏障 — 内核同步的硬件底座
linux·运维·服务器·1024程序员节
我是大猴子2 小时前
py how claude work项目分析
运维·服务器·windows·1024程序员节
H.莓飛2 小时前
【数据结构】排序_OJ题(二):划分与选择
linux·服务器·c语言·开发语言·数据结构·visual studio
djjjx.3 小时前
Linux进程篇(七):环境变量的底层溯源、核心获取机制与安全应用
linux·运维·服务器
.道阻且长.3 小时前
Linux 基本开发工具:编辑器vim,配置vim
linux·运维·服务器·职场和发展·编辑器·vim·1024程序员节