How sendmsg works?

后端 未结 3 1366
醉话见心
醉话见心 2020-12-12 17:33

As you know sendmsg has this declaration:

int sendmsg(int s, const struct msghdr *msg, int flags);

and msghdr

3条回答
  •  执笔经年
    2020-12-12 18:11

    According to http://opengroup.org/onlinepubs/007908799/xns/sendmsg.html ...

    The data from each storage area indicated by msg_iov is sent in turn.

    My interpretation is that sendmsg() will not concatenate the message data stored in the iovec's; each will be sent as a separate message.

    [Edit: My interpretation was not correct; see the other answers for a better explanation.]

提交回复
热议问题