Wang shaodong's Blogabout-socket Back to Home

about-socket

Created2020-03-30|Updated2020-03-30
|Post Views:
Author: wang shaodong
Link: http://linuxmint17.github.io/2020/03/30/about-socket/
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Previous
about-Qt
Next
About IPC
IPC (Inter-Porcess Communication) 进程间通信  多个进程需要协作的时候通信必不可少 IPC 的五种基本方法 Pipes / FIFOs 管道 Message Queues 消息队列 Shared Memory 共享内存 POSIX Semaphores POSIX 信号量 Sockets 套接字 Pipes 的特性 兼容性问题:最早的时候都是半双工,有的系统却提供了全双工的管道 适用范围的问题:只能在具有相同的祖先进程的进程间使用,多数情况是在父子进程之间使用 Pipes 的使用  使用pipe需要了解两个函数 123456789// 需要包含头文件 <unistd.h>int pipe(int fd[2]); // 创建两个文件描述符,fd[0] 用于读取,fd[1]用于写入// 需要包含头文件 <unistd.h> 和 <sys/types.h>pid_t fork(void); // 通过复制父进程创建子进程// 标准头文件 <stdio.h>// The popen() fu...
avatar
wang shaodong
Articles
83
Tags
15
Categories
0
Follow Me
Announcement
This is my Blog
Recent Posts
Contact ways2026-06-13
Hexo Quick Manual2023-01-24
kernel structs pos2022-03-23
busybox SUID support2022-03-23
kernel image formats2022-03-23
© 2025 - 2026 By wang shaodongFramework Hexo 8.1.2|Theme Butterfly 5.5.5