当前位置:网站首页>recv & send
recv & send
2022-06-25 23:57:00 【Chen_Hulk】
socket通信中,客户端服务器可以使用recv & send进行数据收发。
#include <sys/socket.h>
ssize_t recv(int sockfd, void *buff, size_t nbytes, int flags); //buff存放接收数据
ssize_t send(int sockfd, const void *buff, size_t nbytes, int flags); //buff存放待发送数据flags参数值为0或:
| flags | 说明 | recv | send |
|---|---|---|---|
| MSG_DONTROUTE | 绕过路由表查找 | √ | |
| MSG_DONTWAIT | 仅本操作非阻塞 | √ | √ |
| MSG_OOB | 发送或接收带外数据 | √ | √ |
| MSG_PEEK | 窥看外来消息 | √ | |
| MSG_WAITALL | 等待所有数据 | √ |
send执行流程:

recv执行流程:

边栏推荐
猜你喜欢
随机推荐
Oracle database complete uninstallation steps (no screenshot)
Focal loss
The overall process of adding, deleting, modifying and querying function items realized by super detailed SSM framework
正则表达式
Technical foreword - metauniverse
2021 - 1 - 15 notes de pêche Ctrl + C / V
Data arrangement of machinetranslation
浅谈接口测试(二)
Etcd database source code analysis cluster communication initialization
25. histogram comparison
APP测试与WEB测试的区别
毕业季你考虑好去留了吗
超详细SSM框架实现增删改查功能项目整体流程
Accumulation and summary of activation function
MySQL图书借阅系统项目数据库建库表语句(组合主键、外键设置)
手机卡开户的流程是什么?网上开户是否安全么?
同花顺上登录股票账户是安全的吗?同花顺上是如何开股票账户的
Shengxin weekly issue 33
2022防爆电气操作证考试题库及模拟考试
halcon之区域:多种区域(Region)生成(4)
![[excel knowledge and skills] Excel data type](/img/f6/e1ebe033d1a2a266ebda00b10098ed.png)








