Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 22.x
pecl install openswoole-22.0.0
The location of the file to send, only use an absolute file path.
Offset and start point for the given file, default is the beginning.
The length of the data to send, default is the whole file.
true when successful and
false when not.
Send file to the remote server connected socket.
This method is not supported when in UDP protocol mode.
Because you can change the offset and length of the file to send, this helps support resumable file transfers.
The client will return
false if the file does not exist and this method blocks until the entire file has been sent or if a fatal error occurs.
This is a wrapper of the Linux sendfile system call.