My data is naturally segmented, and comes from different sources so I use writev function as follows.
char *buf0 = "short string\n";
struct bar *my_bar;
my_baz = get_my_baz();
iov[0].iov_base = buf0;
iov[0].iov_len = strlen(buf0);
iov[1].iov_base = my_bar;
iov[1].iov_len = sizeof (struct bar);
bytes_written = writev (sockfd, iov, 3);
I want to send all my data. What if writev only write partial data in one time, for example:
bytes_written = 1;
How do I to continue to send the remain data? In write function, we can do as follows enter link description here, how about writev?