初识Unix Domain socket
2014-04-13 22:54
267 查看
佛曰: 并非所有的socket都用于网络通信。
我说过,英语描述东西就是准确, 所以,还是看看维基百科怎么说吧:
A Unix domain socket or IPC socket (inter-process
communication socket) is a data communications endpoint for exchanging data between processes executing within the same host operating system. While similar in functionality tonamed
pipes, Unix domain sockets may be created as connection‑mode (SOCK_STREAM or SOCK_SEQPACKET) or as connectionless (SOCK_DGRAM), while pipes are streams only. Processes using Unix domain sockets do not need to share a common ancestry. The API for
Unix domain sockets is similar to that of an Internet socket, but it does
not use an underlying network protocol for communication. The Unix domain socket facility is a standard component ofPOSIX operating
systems.
Unix domain sockets use the file system as their address name space. They are referenced
by processes as inodes in the file system. This allows two processes to open the same socket in order to communicate.
However, communication occurs entirely within the operating system kernel.
In addition to sending data, processes may send file descriptors across a Unix domain socket
connection using the
我喜欢代码,很多时候, 有这么一种感觉, 没有代码就没有真相。 一段可运行的代码例子,胜过很多无聊的讲解。我家里暂时没有unix/linux环境, 所以就没有代码分享, 在后续博文中,我会转载一些相关的文章,一起学习。
我说过,英语描述东西就是准确, 所以,还是看看维基百科怎么说吧:
A Unix domain socket or IPC socket (inter-process
communication socket) is a data communications endpoint for exchanging data between processes executing within the same host operating system. While similar in functionality tonamed
pipes, Unix domain sockets may be created as connection‑mode (SOCK_STREAM or SOCK_SEQPACKET) or as connectionless (SOCK_DGRAM), while pipes are streams only. Processes using Unix domain sockets do not need to share a common ancestry. The API for
Unix domain sockets is similar to that of an Internet socket, but it does
not use an underlying network protocol for communication. The Unix domain socket facility is a standard component ofPOSIX operating
systems.
Unix domain sockets use the file system as their address name space. They are referenced
by processes as inodes in the file system. This allows two processes to open the same socket in order to communicate.
However, communication occurs entirely within the operating system kernel.
In addition to sending data, processes may send file descriptors across a Unix domain socket
connection using the
sendmsg()and
recvmsg()system calls.
我喜欢代码,很多时候, 有这么一种感觉, 没有代码就没有真相。 一段可运行的代码例子,胜过很多无聊的讲解。我家里暂时没有unix/linux环境, 所以就没有代码分享, 在后续博文中,我会转载一些相关的文章,一起学习。
相关文章推荐
- unix Domain socket(python)
- go语言实现unix domain socket 客户端/服务端
- UNIX Domain Socket IPC (Linux C编程一站式学习)
- UNIX Domain Socket IPC (sockaddr_un )
- 如何解决unix domain socket服务器…
- (unix domain socket)使用udp发送>=128K的消息会报ENOBUFS的错误
- UNIX Domain Socket IPC
- UNIX Domain Socket-同一台主机的进程间通讯(IPC)
- nginx通过unix-domain-socket连接fastcgi
- UNIX Domain Socket IPC
- nginx、php-fpm默认配置与性能–TCP socket还是unix domain socket
- (unix domain socket)使用udp发送>=128K的消息会报ENOBUFS的错误
- Unix Domain Socket– IPC通信机制
- Unix域套接字(Unix Domain Socket)介绍
- UNIX Domain Socket IPC (sockaddr_un )
- UNIX Domain Socket IPC
- Unix domain socket
- 【转】UNIX环境domain socket通信方式
- UNIX Domain Socket IPC
- Linux下的IPC-UNIX Domain Socket【转】