2 ms·
MSG_MORE comes in useful for these examples, where you can't use writev() alone, but do control the sending syscalls: - HTTP (unencrypted) serving static files
by jlokier 6y ago
MSG_MORE comes in useful for these examples, where you can't use writev() alone, but do control the sending syscalls:
- HTTP (unencrypted) serving static files or cache files, to combine sendmsg() for the headers followed by sendfile() for the body. You can't batch using writev() in that case, if you want the benefit of sendfile().
- Transmitting a stream of data that is being forwarded or generated. For example a HTTPS reverse proxy which forwards incoming unencrypted data and formats it into TLS progressively. It can't buffer the whole response as that would add too much delay, so it can send using sendmsg() with MSG_MORE until it reaches the end of the forwarded data.
- nh2 6y agoThat makes sense, thanks!