class GQTP::Backend::Thread::Client

Attributes

host[RW]
port[RW]

Public Class Methods

new(options={}) click to toggle source
# File lib/gqtp/backend/thread.rb, line 72
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/thread.rb, line 92
def close
  @io.close
end
read(size=nil, &block) click to toggle source
# File lib/gqtp/backend/thread.rb, line 88
def read(size=nil, &block)
  @io.read(size, &block)
end
write(*chunks, &block) click to toggle source
# File lib/gqtp/backend/thread.rb, line 84
def write(*chunks, &block)
  @io.write(*chunks, &block)
end