Class SockIO
In: lib/network/sockio.rb
Parent: Object
SockIO
TopLevel

The SockIO class implements the low level interface for TCP sockets.

Methods

Public Class methods

Creates a new SockIO object

sock
The socket which will be used
bufsize
The size of the buffer to use (default is 8192)

Public Instance methods

read will receive a data from the socket.

return
The data read
IOError
A sockets error occurred.
EOFError
The connection has closed normally.

read_flush will kill the input buffer

read_urgent will receive urgent data from the socket.

return
The data read
IOError
A sockets error occurred.
EOFError
The connection has closed normally.

write will transmit a message to the socket

msg
The message string to be sent.
return
false if more data to be written, true if all data written
IOError
A sockets error occurred.
EOFError
The connection has closed normally.

write_flush will kill the output buffer

write_urgent will write urgent data to the socket.

msg
The message string to be sent.
IOError
A sockets error occurred.
EOFError
The connection has closed normally.

[Validate]