read() 和 recv() 以及 send() 和 write() 之间有什么区别? [英] What is the Difference Between read() and recv() , and Between send() and write()?

查看:17
本文介绍了read() 和 recv() 以及 send() 和 write() 之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

read()recv()有什么区别,send()write() 在套接字编程中的性能、速度和其他行为?

What is the difference between read() and recv(), and between send() and write() in socket programming in terms of performances, speed and other behaviors?

推荐答案

不同的是recv()/send()只对socket描述符起作用,让你为实际操作指定某些选项.这些函数更专业一些(例如,您可以设置一个标志来忽略 SIGPIPE,或者发送带外消息...).

The difference is that recv()/send() work only on socket descriptors and let you specify certain options for the actual operation. Those functions are slightly more specialized (for instance, you can set a flag to ignore SIGPIPE, or to send out-of-band messages...).

函数read()/write()通用文件描述符函数,作用于所有描述符.

Functions read()/write() are the universal file descriptor functions working on all descriptors.

这篇关于read() 和 recv() 以及 send() 和 write() 之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆