recv函数的flag参数问题

skyygl 2007-07-23 05:16:15
请问Unix下recv函数的flag参数在设置成MSG_WAITALL时,编译不过,提示:'MSG_WAITALL' was not declared in this scope,是什么原因?要不要包含什么头文件?
...全文
648 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
windowsxp0925 2008-07-11
  • 打赏
  • 举报
回复
遇到此类问题man一下不就知道了?
windowsxp0925 2008-07-11
  • 打赏
  • 举报
回复
#include <sys/types.h>
#include <sys/socket.h>


MSG_WAITALL
This flag requests that the operation block until the full request is satisfied. However, the call may still return less
data than requested if a signal is caught, an error or disconnect occurs, or the next data to be received is of a different
type than that returned.
mhyx_2008 2008-07-11
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 kf701 的回复:]
不支持,那个 flag 基本上没用。
[/Quote]
啊,可是我在一本书上看了说有这个参数的,它的意义是等待直到接收到指定长度的数据才返回,应该很有用才对啊!~
kf701 2007-07-23
  • 打赏
  • 举报
回复
不支持,那个 flag 基本上没用。

23,114

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧