recv len=0 buf
时间: 2023-11-17 14:08:27 浏览: 77
对send(),recv()函数的全面理解
根据引用\[1\]和引用\[2\]的内容,当使用recv函数读取数据时,如果len参数设置为0,表示不读取任何数据。根据引用\[3\]的内容,如果没有数据可读取,recv函数会返回-1,并且错误码为11,表示资源暂时不可用。所以,当recv函数的len参数为0时,如果返回-1并且错误码为11,表示没有数据可读取。
#### 引用[.reference_title]
- *1* [TCP协议下的recv函数](https://blog.csdn.net/fuhanghang/article/details/113540856)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [linux recv 参数len设置为0](https://blog.csdn.net/weixin_30247159/article/details/98186996)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Linux网络编程:recv的返回值](https://blog.csdn.net/m0_54850604/article/details/123981227)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文