Method: IO#writev
- Defined in:
- lib/phusion_passenger/utils.rb
#writev(components) ⇒ Object
Writes all of the strings in the components array into the given file descriptor using the writev() system call. Unlike IO#write, this method does not require one to concatenate all those strings into a single buffer in order to send the data in a single system call. Thus, #writev is a great way to perform zero-copy I/O.
Unlike the raw writev() system call, this method ensures that all given data is written before returning, by performing multiple writev() calls and whatever else is necessary.
io.writev(["hello ", "world", "\n"])
970 971 972 |
# File 'lib/phusion_passenger/utils.rb', line 970 def writev(components) return PhusionPassenger::NativeSupport.writev(fileno, components) end |