undefined method `recvfrom_nonblock'

M

Michael P. Soulier

--hrlM+fc7ZNh8C9pu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.

=2E/bin/../lib/net/tftp+.rb:526:in `download': undefined method
`recvfrom_nonblock' for #<UDPSocket:0xb7f976b4> (NoMethodError)
from ./bin/../lib/net/tftp+.rb:522:in `download'
from ./bin/tftp_client.rb:81:in `main'
from ./bin/tftp_client.rb:98

msg, sender =3D 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
--=20
Michael P. Soulier <[email protected]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

--hrlM+fc7ZNh8C9pu
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFFFfYwKGqCc1vIvggRAqzAAJ9mDuxC3JCggzt1ek5GHzibLLLatACeNTJy
BNENFASwqsj0OROGxDZ6tNk=
=/lrq
-----END PGP SIGNATURE-----

--hrlM+fc7ZNh8C9pu--
 
M

Michael P. Soulier

--q0cnv6xNF3lEC3YB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
--=20
Michael P. Soulier <[email protected]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

--q0cnv6xNF3lEC3YB
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFFFm+wKGqCc1vIvggRAmdQAKClkFl2p0uK/+yn0k3t6Y+NGm1aQgCdFuYb
iOVKU4NDhpsvmGzVWw/MH9Q=
=2r8B
-----END PGP SIGNATURE-----

--q0cnv6xNF3lEC3YB--
 
M

Michael P. Soulier

--LWrJum1q/OvHB6h/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable


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

[msoulier@tigger ~]$ ruby -v
ruby 1.8.4 (2005-12-24) [i686-linux]

Mike
--=20
Michael P. Soulier <[email protected]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

--LWrJum1q/OvHB6h/
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFFFyqUKGqCc1vIvggRAup5AJ0SBa6/zcS5+oBC466WNnPQ7qj+VACgl+24
iwLSgk0mCa4ahFE3Ha5VRR4=
=T7BQ
-----END PGP SIGNATURE-----

--LWrJum1q/OvHB6h/--
 
M

Michael P. Soulier

--JWEK1jqKZ6MHAcjA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

=20
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-revv=
ing
the documentation simply staggers me. Ruby has a long way to go on its
documentation story.

Mike
--=20
Michael P. Soulier <[email protected]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

--JWEK1jqKZ6MHAcjA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFFFy8uKGqCc1vIvggRAi0fAJ4zL4zOoeMnZiGpY2SmpnhLSW2soACfQhaE
cHaKcHL6FV36mcD5sE14f/Q=
=YFaO
-----END PGP SIGNATURE-----

--JWEK1jqKZ6MHAcjA--
 
M

Michael P. Soulier

--bFsKbPszpzYNtEU6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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
--=20
Michael P. Soulier <[email protected]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

--bFsKbPszpzYNtEU6
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD4DBQFFF7w4KGqCc1vIvggRAtxyAJjJP3yl72RJJ1GCj7psJlUFXt4gAKDBaWHB
TlWdIX6a7YyBjYc0UgfvDQ==
=8ZWi
-----END PGP SIGNATURE-----

--bFsKbPszpzYNtEU6--
 
A

Austin Ziegler

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 Britt, 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
 
M

Michael P. Soulier

--IbA9xpzOQlG26JSn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

There aren't. I think you're missing out on several factors and reacting= =20
badly.
=20
1. ruby-doc.org is not maintained by the core Ruby website folks.
James Britt, 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.
=20
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.

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 rele=
ase
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 w=
hat
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
--=20
Michael P. Soulier <[email protected]>
"Any intelligent fool can make things bigger and more complex... It
takes a touch of genius - and a lot of courage to move in the opposite
direction." --Albert Einstein

--IbA9xpzOQlG26JSn
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFFF9nSKGqCc1vIvggRAoqyAJ4g27yx8rBJTSZJowK4or5Hp8cykQCfcxlk
V6s5hrKkfWU82a823iW62kU=
=6pi2
-----END PGP SIGNATURE-----

--IbA9xpzOQlG26JSn--
 
M

MonkeeSage

Michael said:
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
 
J

James Britt

Michael said:
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 Britt

"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
 
J

James Britt

Michael said:
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 Britt

"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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

receive timeout on socket 0
ANN: Tftpplus 0.4 0
alarm? 4
using common layout in Rails 3
FileUtils.cp 4
global error handling in rails 0
undefined method 'flog_files' 1
variable access through self 2

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top