开发者社区> 问答> 正文

linux c socket read方法的疑问?

问下linux c socket read方法是不是遇到rn会自动返回?
还是需要程序主动分割,比如一个一个字节的读取,遇到rn就表示一条消息读取完毕.

展开
收起
a123456678 2016-06-12 10:46:58 1944 0
1 条回答
写回答
取消 提交回答
  • ssize_t read(int fd, void *buf, size_t count);
    On success, the number of bytes read is returned (zero indicates end of file),It is not an error if this number is smaller than the number of bytes requested; this may happen for example because fewer bytes
    2019-07-17 19:33:25
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Alibaba Cloud Linux 3 发布 立即下载
ECS系统指南之Linux系统诊断 立即下载
ECS运维指南 之 Linux系统诊断 立即下载