你知道sendmsg有这个声明:
int sendmsg(int s,const struct msghdr * msg,int flags);
并且msghdr结构具有以下形式:
struct msghdr {
void * msg_name; /* optional address */
socklen_t msg_namelen; /* size of address */
struct iovec * msg_iov; /* scatter/gather array */
size_t msg_iovlen; /* # elements in msg_iov */
void * msg_control; /* ancillary data,see below */
socklen_t msg_controllen; /* ancillary data buffer len */
int msg_flags; /* flags on received message */
};
如你所见,msghdr有一个缓冲区数组,iovec和缓冲区数msg_iovlen.我不知道sendmsg如何发送这些缓冲区.它连接所有缓冲区并发送还是发送在for循环?