Linux下,writeread,recvsend, recvfromsendto的区别Linux下,write/read,recv/send, recvfrom/sendto的区别
Linux下,write/read,recv/send, recvfrom/sendto的区别先说概念和应用场景:read/wirte是通用的文件描述符操作;recv/send 通常应用于TCP;recvfrom/sendto通常应用于UDP。read/writessize_t write(int fd, const void*buf,size_t nbytes);ssize_t read(int fd,void *buf,size_t nbyte); write函数是将buf中的nbyt