NAME

Net::STOMP::Client::IO - Input/Output support for Net::STOMP::Client

DESCRIPTION

This module provides Input/Output (I/O) support for Net::STOMP::Client.

It is used internally by Net::STOMP::Client and should not be used elsewhere.

Two I/O modes are supported: blocking and non-blocking. See the next two sections for more information.

BLOCKING I/O

With blocking I/O, the socket is in blocking mode and select() is used to find out if read() or write() can be attempted. This is the simplest approach but it may fail (hang) in some situations, especially with SSL.

This was the mode used in Net::STOMP::Client up to version 1.7.

NON-BLOCKING I/O

With non-blocking I/O, the socket is in non-blocking mode and read() and write() are called in any case. The code in Net::STOMP::Client::IO has to handle errors like EAGAIN or EWOULDBLOCK. This is the most reliable approach (no deadlocks) but it is slightly less efficient.

This mode has been introduced in Net::STOMP::Client version 1.8 and is the default since then.

FUNCTIONS

This module provides the following functions and methods:

new(SOCKET)

create a new Net::STOMP::Client::IO object

queue_data(DATA)

queue (append to the internal outgoing buffer) the given data (a string reference); return the length of DATA in bytes

send_data(TIMEOUT)

send some queued data to the socket; return the total number of bytes written

receive_data(TIMEOUT)

receive some data from the socket and put it in the internal incoming buffer; return the total number of bytes read

incoming_buffer_reference()

return a reference to the internal incoming buffer (a string)

outgoing_buffer_length()

return the length of the internal outgoing buffer

AUTHOR

Lionel Cons http://cern.ch/lionel.cons

Copyright CERN 2010-2012