class GQTP::Backend::Synchronous::Client
Attributes
host[RW]
port[RW]
Public Class Methods
new(options={})
click to toggle source
# File lib/gqtp/backend/synchronous.rb, line 61 def initialize(options={}) @options = options @host = options[:host] || "127.0.0.1" @port = options[:port] || 10043 begin @socket = TCPSocket.open(@host, @port) rescue SystemCallError raise ConnectionError.new(@host, @port, $!) end @io = IO.new(@socket) end
Public Instance Methods
close()
click to toggle source
# File lib/gqtp/backend/synchronous.rb, line 81 def close @io.close end
read(size=nil, &block)
click to toggle source
# File lib/gqtp/backend/synchronous.rb, line 77 def read(size=nil, &block) @io.read(size, &block) end
write(*chunks, &block)
click to toggle source
# File lib/gqtp/backend/synchronous.rb, line 73 def write(*chunks, &block) @io.write(*chunks, &block) end