Bug #1805
closedUDPSocket#recvfrom hangs
Description
=begin
The following code raises an error in 1.8.x, but hangs in 1.9.x:
require 'socket'
udp = UDPSocket.open
udp.connect('127.0.0.1', 7)
udp.send('ping', 0)
array = udp.recvfrom(64)
=end
Updated by shyouhei (Shyouhei Urabe) over 14 years ago
=begin
Daniel Berger wrote:
ruby -v: ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin8.11.1]
The following code raises an error in 1.8.x, but hangs in 1.9.x:
Can't confirm on my machine. Maybe a problem of darwin specific?
zsh % ruby -ve"
zsh > require 'socket'
zsh > udp = UDPSocket.open
zsh > udp.connect('127.0.0.1', 7)
zsh > udp.send('ping', 0)
zsh > array = udp.recvfrom(64)
zsh > "
ruby 1.9.2dev (2009-07-22 trunk 24241) [x86_64-linux]
-e:6:in recvfrom': Connection refused - recvfrom(2) (Errno::ECONNREFUSED) from -e:6:in
'
zsh: exit 1 ~/target/trunk/bin/ruby
Attachment: signature.asc
=end
Updated by djberg96 (Daniel Berger) over 14 years ago
=begin
You must have fixed this in trunk, because I see the same behavior on Linux.
=end
Updated by matz (Yukihiro Matsumoto) over 14 years ago
=begin
Hi,
In message "Re: [ruby-core:24507] [Bug #1805] UDPSocket#recvfrom hangs"
on Thu, 23 Jul 2009 00:29:43 +0900, Daniel Berger redmine@ruby-lang.org writes:
|You must have fixed this in trunk, because I see the same behavior on Linux.
Could you supply more information? I am facing the same situation as
Shyohei did in [ruby-core:24504], no hang.
matz.
=end
Updated by djberg96 (Daniel Berger) over 14 years ago
=begin
djberge@caesar:~/programming/ruby$ uname -a
Linux caesar 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686 GNU/Linux
djberge@caesar:~/programming/ruby$ /opt/bin/ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-linux]
djberge@caesar:~/programming/ruby$ /opt/bin/ruby udp_test.rb # Hangs
Shyohei says he is using 1.9.2dev. I'm using 1.9.1p243.
=end
Updated by djberg96 (Daniel Berger) over 14 years ago
=begin
Ok, I confirmed that it's fixed in 1.9.2dev. You can close this out.
Thanks,
Dan
=end