随笔分类 - UNIX网络编程 巻1
《UNIX网络编程 巻1:套接字联网API》读书笔记
摘要:### select```#include #include int select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set exceptset, const struct timeval *timeout);```- timeou...
阅读全文
摘要:### signal信号是一种软件中断,异步发生,在进程运行的时候随时可能发生。信号可以:- 由一个进程发给另一个进程,或发给自身- 由内核发给某个进程信号的action:1. signal handler,在信号发生时被调用,这个过程也称为捕获信号。SIGKILL/SIGSTOP两个信号不能被捕获...
阅读全文
摘要:---## 基本函数接口### socket函数```#include int socket(int family, int type, int protocol);```成功时返回一个非负整数,与文件描述符类似,称为套接字描述符 sockfd。各参数的意义:1. family 指明协议族。取值为以...
阅读全文
摘要:## 套接字地址结构### ipv4套接字地址结构在头文件 中定义```struct in_addr { in_addr_t s_addr; //32位ipv4地址};struct sockaddr_in { uint8_t sin_len; sa_family_t ...
阅读全文

浙公网安备 33010602011771号