Non-blocking TCPServer?

hi,

maybe i'm understanding how this is meant to work incorrectly, but i
would have assumed TCPServer#accept would return immediately if i had
set it to nonblocking. the accept syscall on Linux would not have
blocked, according to the manpage..

require 'socket'
require 'io/nonblock'

s = TCPServer.new('localhost', 9000)
s.nonblock = true
s.accept
$stderr.puts "returned"

when i run this in a test script, accept blocks.

$ ruby -v
ruby 1.8.2 (2004-08-24) [i386-linux]

leon

Hi,

ยทยทยท

In message "Re: non-blocking TCPServer ?" on Mon, 27 Sep 2004 08:03:12 +0900, leon breedt <bitserf@gmail.com> writes:

s = TCPServer.new('localhost', 9000)
s.nonblock = true
s.accept
$stderr.puts "returned"

when i run this in a test script, accept blocks.

It shouldn't. I will fix.

              matz.