Method: LogfileTransfer.conn

Defined in:
lib/logfile_transfer.rb

.conn(cmd) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/logfile_transfer.rb', line 59

def self.conn cmd
  s = TCPSocket.open(@hostname, @port)
  s.puts cmd

  while line = s.gets
    puts line.chop
  end

  true
rescue =>e
  # puts "#{e}"

  false
ensure  
  s.close unless s==nil
end