[#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,

[ ruby-Bugs-4457 ] Strange interactions between Struct and 'pp'

From: noreply@...
Date: 2006-05-12 15:13:51 UTC
List: ruby-core #7865
Bugs item #4457, was opened at 2006-05-12 17:13
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=4457&group_id=426

Category: Standard Library
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Gustav Munkby (grddev)
Assigned to: Nobody (None)
Summary: Strange interactions between Struct and 'pp'

Initial Comment:

A structure which defines an accessor named "members" cannot be used together with the standard library pp.

The following program works as expected, and outputs the contents of the structure:

> ruby -rpp -e 'pp Struct.new(:member).new'
#<struct  member=nil>

If the accessor instead is named members, the above operation fails with an exception:

> ruby -rpp -e 'pp Struct.new(:members).new'
/usr/lib/ruby/1.8/pp.rb:181:in `__send__': undefined method `each' for nil:NilClass (NoMethodError)

The reason is that the pp-library uses the members method of the created structure to enumerate the members. The problem is easy to fix by using the members method on the class instead. The documentation for Struct suggest that you should use members in the said way however, and it's not clear (to me) that Struct.new(:members) overrides this.



----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=4457&group_id=426

In This Thread

Prev Next