From: Arto Pastinen Date: 2005-12-16T21:42:38+09:00 Subject: Re: nonblocking TCPSocket in multithread software. http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/158720 .. sad .. huoh.. 2005/12/16, Arto Pastinen : > pah.. now it just dont do nothing.. > > 2005/12/16, Arto Pastinen : > > It seems work if i lock thread.. funny.. :) > > > > a = Thread.new do > > s = TCPSocket.new('localhost', 4343) > > s.nonblock = true > > Thread.critical { > > p s.read # it block's here no matter what i do > > } > > end > > a.join > > > > - Artsi > > > > 2005/12/16, Arto Pastinen : > > > Hi! > > > > > > Why this blocks? > > > > > > a = Thread.new do > > > s = TCPSocket.new('localhost', 4343) > > > s.nonblock = true > > > p s.read # it block's here no matter what i do > > > end > > > a.join > > > > > > .. and how to make it nonblock? > > > > > > It works fine if i drive it in main thread. > > > > > > Thnx: Artsi > > > > > > > > > > > >