Operating System: Windows XP
Ruby Version: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

Program for TCPServer:


require "socket"
Thread.abort_on_exception = true
dts = TCPServer.new('localhost', 20000)
begin
loop do
  puts" Inside the Loop to accept Client Request #{dts}"
  Thread.start(dts.accept_nonblock) do |s|
  print(s, " is accepted\n")
    print(s, " is accepted\n")
        s.write(Time.now)
        print(s, " is gone\n")
        s.close
  end

end
end

Output while running this on WindowsXP Operating system

C:\Documents and Settings\verma.r\My Documents\RubyTest>ruby server.rb
 Inside the Loop to accept Client Request #<TCPServer:0x11cf8c8>
C:\Documents and Settings\verma.r\My Documents\RubyTest>ruby server.rb


Problem:

After printing the first puts" Inside the Loop to accept Client Request
#{dts}". The programs crashed in Thread.start(dts.accept_nonblock)
without even using any client to connect to server.

This program is working on some PC and gives this error on other.
Has anyone experienced the same problem before. What can be region for
the crash please suggest.

Thanks

-- 
Posted via http://www.ruby-forum.com/.