From: bar hofesh Date: 2012-08-27T07:05:46+09:00 Subject: Threading methods & args Well, this is my simple port scanner Instead of actually Threading the scan it just prints: "C:\Users\admin>C:\Ruby193\bin\ruby.exe C:\Users\admin\Desktop\port-scanner.rb choose host:" why ? require 'socket' def scanner print "choose host: " arg1 = gets.chomp print "choose starting port: " arg2 = gets.to_i print "choose ending port: " arg3 = gets.to_i while arg2 <= arg3 begin s = TCPSocket.new(arg1, arg2) # arg1 = host, arg2 = sport, arg3 = eport if s puts "Port #{arg2} is open!" end rescue puts "Port #{arg2} is closed!" end arg2 += 1 end end Thread.start {scanner} -- Posted via http://www.ruby-forum.com/.