From: "Bill Kelly" <billk / cts.com>

> >> require 'socket'
> => true
> >> require 'thread'
> => true
> >> cl = TCPSocket.new("localhost", 12345)
> => #<TCPSocket:0x2dbaf88>
> >> th1 = Thread.new {  sleep(1.0) until cl.eof?  }
> => #<Thread:0x2db6dd0 sleep>
> >> th2 = Thread.new {  sleep(1.0) until cl.eof?  }
> => #<Thread:0x2db2bb8 sleep>
> >> cl.eof?
> 
>    ^^^^^^^^ hang


I guess it must be something very basic I'm not aware of
about #eof? ... Because even:

> >> require 'socket'
> => true
> >> require 'thread'
> => true
> >> cl = TCPSocket.new("localhost", 12345)
> => #<TCPSocket:0x2dbaf88>
> >> cl.eof?

hangs.


Is it not possible to check for EOF without blocking?


Regards,

Bill