[MacRuby] #940: MacRuby should throw an exception when calls IO#read/write without status of READABLE/WRITABLE.

MacRuby ruby-noreply at macosforge.org
Thu Oct 7 18:22:12 PDT 2010


#940: MacRuby should throw an exception when calls IO#read/write without status
of READABLE/WRITABLE.
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  minor                 |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 Test Script:
 {{{
 #!ruby
 require 'socket'

 sock = TCPServer.new(10000)
 sock.close_read
 begin
   sock.read
 rescue IOError => err
   p err
 end
 sock.close

 sock = TCPServer.new(10000)
 sock.close_write
 begin
   sock.write("xxxx")
 rescue IOError => err
   p err
 end
 }}}

 Result:
 {{{
 $ ruby19 test_socket.rb
 #<IOError: not opened for reading>
 #<IOError: not opened for writing>

 $ macruby test_socket.rb
 /Users/watson/tmp/test_socket.rb:1:in `<main>': Socket is not connected -
 read() failed (Errno::ENOTCONN)
 MACO /Users/watson/tmp%
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/940>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list