Project

General

Profile

Actions

Bug #1805

closed

UDPSocket#recvfrom hangs

Added by djberg96 (Daniel Berger) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin8.11.1]
Backport:
[ruby-core:24502]

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

Actions #1

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

Actions #2

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

Actions #3

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

Actions #4

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

Actions #5

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

Actions #6

Updated by drbrain (Eric Hodel) over 14 years ago

  • Status changed from Open to Closed

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0