Undefined method `recvfrom_nonblock'

Hey,

The socket docs at http://www.ruby-doc.org/stdlib/ say that UDPSocket
has a
method, recvfrom_nonblock, but when I try to use it, I get this.

./bin/…/lib/net/tftp+.rb:526:in download': undefined methodrecvfrom_nonblock’ for #UDPSocket:0xb7f976b4 (NoMethodError)
from ./bin/…/lib/net/tftp+.rb:522:in download' from ./bin/tftp_client.rb:81:inmain’
from ./bin/tftp_client.rb:98

msg, sender = sock.recvfrom_nonblock(MaxBlkSize)

The docs are for 1.8.4, and that’s what I’m using. Any idea what’s up
here?

Thanks,
Mike

On 9/23/06, Michael P. Soulier [email protected] wrote:

Hey,

The socket docs at http://www.ruby-doc.org/stdlib/ say that UDPSocket has
a
method, recvfrom_nonblock, but when I try to use it, I get this.

Sync to the latest Ruby. I’m not sure about that specific API but a
bunch of
changes were made to nonblocking I/O late last May,

On 24/09/06 Francis C. said:

Sync to the latest Ruby. I’m not sure about that specific API but a bunch of
changes were made to nonblocking I/O late last May,

Is the latest Ruby not 1.8.4? The docs say that they are for that
version, and
that’s what I’m running. What gives?

Mike

Michael P. Soulier wrote:

On 24/09/06 Francis C. said:

Sync to the latest Ruby. I’m not sure about that specific API but a bunch
of changes were made to nonblocking I/O late last May,

Is the latest Ruby not 1.8.4? The docs say that they are for that version,
and that’s what I’m running. What gives?

The latest stable release is 1.8.5:

http://www.ruby-lang.org/en/news/2006/08/29/ruby-1-8-5-released/

On 9/24/06, Paul L. [email protected] wrote:

The latest stable release is 1.8.5:

The snapshots beginning around June 1 still carried a 1.8.4 release
number,
but they had the current set of nonblocking i/o methods. If the OP is
running an earlier 1.8.4 (perhaps the Christmas release), he won’t have
the
methods. That’s what I was hoping he would tell us. If he’s running a
back
version, then a simple update should solve his prob.

On 9/24/06, Michael P. Soulier [email protected] wrote:

Say ruby -v at a command shell and look at the build date.

On 25/09/06 Paul L. said:

The latest stable release is 1.8.5:

http://www.ruby-lang.org/en/news/2006/08/29/ruby-1-8-5-released/

Yes, but at http://www.ruby-doc.org/, the links say 1.8.4.

[[email protected] ~]$ ruby -v
ruby 1.8.4 (2005-12-24) [i686-linux]

Mike

Michael P. Soulier wrote:

/ …

Yes, but at http://www.ruby-doc.org/, the links say 1.8.4.

Probably because there is no documentation that is specific to 1.8.5.

On 25/09/06 Paul L. said:

Yes, but at http://www.ruby-doc.org/, the links say 1.8.4.

Probably because there is no documentation that is specific to 1.8.5.

And yet 1.8.5 is the latest stable. Releasing a new version without
up-revving
the documentation simply staggers me. Ruby has a long way to go on its
documentation story.

Mike

On 9/24/06, Michael P. Soulier [email protected] wrote:

[[email protected] ~]$ ruby -v
ruby 1.8.4 (2005-12-24) [i686-linux]

That’s what I expected. Update Ruby, get past the documentation issue,
and
you should be ok with nonblocking i/o. In regard to timing, I would use
select rather than SIGALRM.

On 25/09/06 Francis C. said:

That’s what I expected. Update Ruby, get past the documentation issue, and
you should be ok with nonblocking i/o. In regard to timing, I would use
select rather than SIGALRM.

I find it odd that there are multiple released 1.8.4s. That’s never
happened
with any other language that I use.

I ended up using Timeout::timeout to timeout my recvfrom call. You’re
right,
in general, select/poll would be better.

Mike

On 9/25/06, Michael P. Soulier [email protected] wrote:

On 25/09/06 Francis C. said:

That’s what I expected. Update Ruby, get past the documentation issue, and
you should be ok with nonblocking i/o. In regard to timing, I would use
select rather than SIGALRM.
I find it odd that there are multiple released 1.8.4s. That’s never happened
with any other language that I use.

There aren’t. I think you’re missing out on several factors and reacting
badly.

  1. ruby-doc.org is not maintained by the core Ruby website folks.
    James B., the maintainer of ruby-doc.org, does so on his time. The
    core Ruby website is and always has been ruby-lang.org and can be
    considered more up-to-date than most other websites about Ruby with
    respect to releases. ruby-doc.org is good, but it is an independent
    but related project, not part of the main website.

  2. There was only one release of Ruby 1.8.4. There wasn’t even a
    security patch (1.8.4.z) released. After release, there are dated
    stable snapshots available. It is possible to get a Ruby 1.8.5 that
    has further fixes available with recent changes as of right now. But
    if you download Ruby 1.8.5, you’re getting ONLY what was released
    there.

-austin

Michael P. Soulier wrote:

I downloaded the 1.8.4 tarball long after it was considered the stable
release, AFAIK. If there was only one release, then I got it. The links to the
1.8.4 docs should lead one to docs on 1.8.4, yes?

I guess if those were supposed to be the 1.8.4 docs, then yeah. But
they say right in the page you linked to, under the second heading;
“What You’ll Find Here”:

"Because the source code comments go straight into Ruby’s CVS, the only
way to get up-to-date documentation is to use the latest Ruby code as a
source. There are two important side effects here:

* the documentation may be ahead of Ruby 1.8.0, which many users

will have, and
* the documentation is certainly out of step with Ruby 1.6.x.

The ruby_1_8 branch of the Ruby source code is used to produce the
documentation. So you will see the latest that Ruby 1.8.x has to offer,
not the experimental 1.9." ( http://www.ruby-doc.org/stdlib/ )

And what’s the latest 1.8.x?

According to http://www.ruby-lang.org/en/downloads/ , it is 1.8.5.

If you want the documentation for your particular version, why not use
the built in ri command (like python’s pydoc), or the help() method
from irb (like python help())? Or just run rdoc on the source yourself?
Or use http://stdlib-doc.rubyforge.org/rdoc/index.html ?

Regards,
Jordan

Michael P. Soulier wrote:

On 25/09/06 Paul L. said:

The latest stable release is 1.8.5:

http://www.ruby-lang.org/en/news/2006/08/29/ruby-1-8-5-released/

Yes, but at http://www.ruby-doc.org/, the links say 1.8.4.

That link is wrong. I forgot to update it.

The site fetches the current code for the latest release from CVS, so
the API docs should always reflect that. The page links, which are
maintained by hand, might fall behind at times.

Thanks for bringing this to my attention.

You should be able to see the actual 1.8.4 core API docs at

http://www.ruby-doc.org/core-1.8.4/


James B.

“To predict the behavior of ordinary people in advance, you only have to
assume that they will always try to escape a disagreeable situation with
the smallest possible expenditure of intelligence.”
- Friedrich Nietzsche

On 25/09/06 Austin Z. said:

  1. There was only one release of Ruby 1.8.4. There wasn’t even a
    security patch (1.8.4.z) released. After release, there are dated
    stable snapshots available. It is possible to get a Ruby 1.8.5 that
    has further fixes available with recent changes as of right now. But
    if you download Ruby 1.8.5, you’re getting ONLY what was released
    there.

Core site or not,

http://www.ruby-lang.org/en/documentation/

points to ruby-doc as it’s standard and core library references. They
shouldn’t do that if they’re not vouching for their authenticity.

I downloaded the 1.8.4 tarball long after it was considered the stable
release, AFAIK. If there was only one release, then I got it. The links
to the
1.8.4 docs should lead one to docs on 1.8.4, yes?

If one goes to http://www.python.org/doc/, you get docs for the latest
release
that are up-to-date, and maintained by the project itself. More
importantly,
as you’re likely not using the latest version in production, you can go
to
http://www.python.org/doc/versions/ and get old versions for your
version. You
can also separately browse the in-development versions. It’s always
clear what
you are looking at.

Now, if it’s very difficult to keep these up-to-date, then there are
issues
within the Ruby development community to solve, since the tools are
there.
Otherwise, it would be very nice to see the Ruby development community
maintain a model like I’ve referenced here. I constantly find it
difficult to
get the information that I need to effectively use the language, and I
don’t
think that I’m alone.

It’s worth the battle so far, as I am loving the language. Still, the
pickaxe book as an API reference is incomplete. ruby-doc says it’s
showing
1.8.4 but it’s apparently not. There’s a free pickaxe book online from
the 1.6
stream. I get inconsistent results on the code in the tarball from the
ri
tool. This is an exercise in frustration. I have precious little free
coding
time for my own projects, and I don’t want to spend it crawling through
Ruby
source trying to decipher the API. It’s very difficult to justify my
using it
internally at work when I’m surrounded by Java people who have far
better
documentation than me.

How can I help this situation? I guess I’ll start by talking to the
owners of
ruby-doc, and seeing if I can help.

Mike

Michael P. Soulier wrote:

respect to releases. ruby-doc.org is good, but it is an independent
Core site or not,

http://www.ruby-lang.org/en/documentation/

points to ruby-doc as it’s standard and core library references. They
shouldn’t do that if they’re not vouching for their authenticity.

I downloaded the 1.8.4 tarball long after it was considered the stable
release, AFAIK. If there was only one release, then I got it. The links to the
1.8.4 docs should lead one to docs on 1.8.4, yes?

Sure. Unless the guy running the site is busy and forgets to update the
text for some links.

Life happens.

The core and stdlib links on ruby-doc should always be pointing to the
current docs for the current release. The text describing those links
should correctly indicate what the release happens to be. They were
wrong, I’ve fixed them, and the world keeps turning.

How can I help this situation? I guess I’ll start by talking to the owners of
ruby-doc, and seeing if I can help.

Join the ruby-doc mailing list:

http://www.ruby-lang.org/en/community/mailing-lists/


James B.

“Programs must be written for people to read, and only incidentally
for machines to execute.”

  • H. Abelson and G. Sussman
    (in "The Structure and Interpretation of Computer Programs)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs