高性能批量读写网络包 补遗

鸟窝 at 
前一段时间写了一篇高性能批量读写网络包, 里面介绍了 sendmmsg 系统调用,可以批量发送网络包,有读者询问这和 writev 有什么区别。其实看它们的定义,就知道区别在哪里了:123int sendmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen, int flags);ssize_t writev(int fd, const struct iovec *iov, int iovcnt);sendmmsg()系统调用是 sendmsg(2)的扩展,它允许调用方使用单个系统调用在套接字上传输多个消息。 (这对于某些应用程序……