read() 和 recv() 以及 send() 和 write() 之间有什么区别? [英] What is the Difference Between read() and recv() , and Between send() and 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屋!