Im programming webserver (C), which should send big files. My question is:
What are the main differences in two syscalls: write
and sendfile
. Does sendfile
depends on size of socket system buffer? I noticed that write
often writes less then I requested.
For example, if got many requests for one file: should i open it, copy into memory and use write
, or maybe I can do sendfile
for each client?
Thanks in advance for all answers.