UNP前六章 回射服务模型 解析
本文试对UNP一书中截止到第六章的回射服务模型进行剖析,重点在于讲解代码为什么怎么做。下面的代码分别对应书中的5-12 tcpserv04.c,6-13 strcliselect02.c。
服务器代码:
#include <unp.h>
void sig_chld(int signo) {
pid_t pid;
int stat;
while ((pid = waitpid(-1, &stat, WNOHANG)) > 0) {
pr
原创
2021-05-16 19:12:27 ·
154 阅读 ·
0 评论