Skip to content

Commit eac5f55

Browse files
authored
Update process_commu.md
1 parent 0789c55 commit eac5f55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: os/4_process/process_commu.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,14 @@ $ kill -l
238238
我们来看看创建 socket 的系统调用:
239239

240240
```c
241-
int socket(int domain, int type, int protocOl)
241+
int socket(int domain, int type, int protocol)
242242
```
243243
244244
三个参数分别代表:
245245
246246
- domain 参数用来指定协议族,比如 AF_INET 用于 IPV4、AF_INET6 用于 IPV6、AF_LOCAL/AF_UNIX 用于本机;
247247
- type 参数用来指定通信特性,比如 SOCK_STREAM 表示的是字节流,对应 TCP、SOCK_DGRAM 表示的是数据报,对应 UDP、SOCK_RAW 表示的是原始套接字;
248-
- protocOl 参数原本是用来指定通信协议的,但现在基本废弃。因为协议已经通过前面两个参数指定完成,protocol 目前一般写成 0 即可;
248+
- protocol 参数原本是用来指定通信协议的,但现在基本废弃。因为协议已经通过前面两个参数指定完成,protocol 目前一般写成 0 即可;
249249
250250
根据创建 socket 类型的不同,通信的方式也就不同:
251251

0 commit comments

Comments
 (0)