Hello everybody,
I noticed yesterday then any non blocking socket return in blocking mode
inside a thread. Is it on purpose, or a bug?

To be clearer, this script above, as expected, will not block:

	require 'socket'
	Thread.new do
		sleep 2
		client = TCPSocket.new('localhost', '1999') 
		puts "send a message"
		client.puts "message"
	end
	server = TCPServer.new("0.0.0.0","1999")
	sock = server.accept
	sock.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK)
	puts "try to read it...
	sock.read(100)
	puts "done !"


But this one will:

	require 'socket'
	Thread.new do
		sleep 2
		client = TCPSocket.new('localhost', '1999') 
		puts "send a message"
		client.puts "message"
	end
	server = TCPServer.new("0.0.0.0","1999")
	thr = Thread.new do
		sock = server.accept
		sock.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK)
		puts "try to read it...
		sock.read(100)
		puts "done !"
	end
	thr.join

Just in case, I'm running ruby 1.8.1 on Suse 9.0 with a 2.4.21 kernel

yannick