class Farcall::SocketStream
Stream-like object to wrap very strange ruby socket IO
Public Class Methods
new(socket)
click to toggle source
# File lib/farcall/json_transport.rb, line 9 def initialize socket @socket = socket end
Public Instance Methods
<<(data)
click to toggle source
# File lib/farcall/json_transport.rb, line 30 def << data write data end
eof?()
click to toggle source
# File lib/farcall/json_transport.rb, line 26 def eof? @socket.eof? end
read(length=1)
click to toggle source
# File lib/farcall/json_transport.rb, line 13 def read length=1 # data = '' # while data.length < length # data << @socket.recv(length - data.length, Socket::MSG_WAITALL) # end # data @socket.read length end
write(data)
click to toggle source
# File lib/farcall/json_transport.rb, line 22 def write data @socket.write data end