Class _Stdio.sendfile
- Description
Send
headers + from_fd[off..off+len-1] + trailerstoto_fdasyncronously.- Note
This is the low-level implementation, which has several limitations. You probably want to use Stdio.sendfile() instead.
- See also
- Method
create
_Stdio.sendfile _Stdio.sendfile(array(string)headers,objectfrom,intoffset,intlen,array(string)trailers,objectto,function(:void)callback,mixed...args)- Description
Low-level implementation of Stdio.sendfile().
Sends headers followed by len bytes starting at offset from the file from followed by trailers to the file to. When completed callback will be called with the total number of bytes sent as the first argument, followed by args.
Any of headers, from and trailers may be left out by setting them to
0.Setting offset to
-1means send from the current position in from.Setting len to
-1means send until from's end of file is reached.- Note
Don't use this class directly! Use Stdio.sendfile() instead.
In Pike 7.7 and later the callback function will be called from the backend associated with to.
- Note
May use blocking I/O and thus trigger process being killed with SIGPIPE when the other end closes the connection. Add a call to signal() to avoid this.
- See also