Method Stdio.sendfile()->create()
- Method
create
 
- Stdio.sendfile Stdio.sendfile(- array(- string)- headers,- object- from,- int- offset,- int- len,- array(- string)- trailers,- object- to,- function(:- void)- callback,- mixed...- args)
- Description
- Low-level implementation of Stdio.sendfile(). - Sends - headersfollowed by- lenbytes starting at- offsetfrom the file- fromfollowed by- trailersto the file- to. When completed- callbackwill be called with the total number of bytes sent as the first argument, followed by- args.- Any of - headers,- fromand- trailersmay be left out by setting them to- 0.- Setting - offsetto- -1means send from the current position in- from.- Setting - lento- -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 - callbackfunction 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