------ art_44172_7039407.1183013487910
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Consider the snippet -
#------------------------------
require 'socket'
require 'thread'
t hread.new do
sock DPSocket.new
sock.bind("127.0.0.1", 9000)
2.times do
IO.select([sock])
msg ock.recvfrom_nonblock(1000)
puts msg
end
end
puts "installing signal handler"
trap("INT") { puts "control-c received" } # do nothing, just print
t.join
# ---------------------------------
One user thread blocks on IO and the main thread joins for this thread but
after installing a signal handler.
I would expect the control-c to be trapped by this but that does not happen
until the thread blocked for IO is unblocked by a network message.
My ruby is "ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]"
Am I missing something here?
TIA
- Nasir
------ art_44172_7039407.1183013487910--