[#7872] Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...>

All, I needed a nonblocking socket connect for my asynchronous-event

18 messages 2006/05/14
[#7873] Re: Nonblocking socket-connect — Tanaka Akira <akr@...17n.org> 2006/05/14

In article <3a94cf510605140559l7baa0205le341dac4f47d424b@mail.gmail.com>,

[#7874] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

How about introducing the method Socket#set_nonblocking, or alternatively

[#7875] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

[#7876] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

Well, it's ok then. I'm comfortable adding in the nonblocking

[#7877] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

Re: [ ruby-Bugs-4498 ] raise can create custom exception objects which aren't properly initialized

From: ts <decoux@...>
Date: 2006-05-17 11:52:22 UTC
List: ruby-core #7892
>>>>> "n" == noreply  <noreply@rubyforge.org> writes:

n> then Ruby allows to raise an exception *without creating the object yourself*
n>   raise MyError, &quot;this is an error message&quot;

n> which is obviously wrong, since the MyError object created by raise
n> won't be properly initialized.

 I've not understood

moulon% cat b.rb
#!/usr/bin/ruby

class MyError < RuntimeError
   attr_reader :info

   def initialize(info)
      @info = info
   end

end

begin
   raise MyError, "this is an error message"
rescue
  p $!.info
end
moulon% 

moulon% ./b.rb
"this is an error message"
moulon% 

 #initialize is called ???


Guy Decoux

In This Thread

Prev Next