Class | PhusionPassenger::MessageChannel |
In: |
lib/phusion_passenger/message_channel.rb
|
Parent: | Object |
This class allows reading and writing structured messages over I/O channels. This is the Ruby implementation of ext/common/Utils/MessageIO.h; see that file for more information.
io | [RW] | The wrapped IO object. |
Close the underlying IO stream. Might raise SystemCallError or IOError when something goes wrong.
Read an array message from the underlying file descriptor. Returns the array message as an array, or nil when end-of-stream has been reached.
Might raise SystemCallError, IOError or SocketError when something goes wrong.
Read an array message from the underlying file descriptor and return the result as a hash instead of an array. This assumes that the array message has an even number of elements. Returns nil when end-of-stream has been reached.
Might raise SystemCallError, IOError or SocketError when something goes wrong.
Read a scalar message from the underlying IO object. Returns the read message, or nil on end-of-stream.
Might raise SystemCallError, IOError or SocketError when something goes wrong.
The buffer argument specifies a buffer in which read_scalar stores the read data. It is good practice to reuse existing buffers in order to minimize stress on the garbage collector.
The max_size argument allows one to specify the maximum allowed size for the scalar message. If the received scalar message‘s size is larger than max_size, then a SecurityError will be raised.
Send an array message, which consists of the given elements, over the underlying file descriptor. name is the first element in the message, and args are the other elements. These arguments will internally be converted to strings by calling to_s().
Might raise SystemCallError, IOError or SocketError when something goes wrong.
Send a scalar message over the underlying IO object.
Might raise SystemCallError, IOError or SocketError when something goes wrong.