Bugs item #6802, was opened at 2006-11-21 03:31
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=6802&group_id=426

>Category: Networking / Communication / P
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: David Welton (davidw)
Assigned to: Nobody (None)
Summary: net/ftp hangs

Initial Comment:
I am trying to interact with a remote FTP server.  However, Ruby's ftp code is hanging.

lsof shows:

ruby       6538     davidw    4u     IPv4 256375                TCP byron:46103->ftp1test.example.com:ftp (ESTABLISHED)
ruby       6538     davidw    5u     IPv4 256627                TCP byron:36936 (LISTEN)

So, it has a socket listening... however, it's hung:

davidw@byron:~$ strace -p 6538
Process 6538 attached - interrupt to quit
accept(5, 

Remote server is:

220 Serv-U FTP Server v4.1 for WinSock ready...

When I ctrl-c it, I get:

/usr/lib/ruby/1.8/net/ftp.rb:340:in `accept'
/usr/lib/ruby/1.8/net/ftp.rb:340:in `transfercmd'
/usr/lib/ruby/1.8/net/ftp.rb:421:in `retrlines'
/usr/lib/ruby/1.8/monitor.rb:229:in `synchronize'
/usr/lib/ruby/1.8/net/ftp.rb:419:in `retrlines'
/usr/lib/ruby/1.8/net/ftp.rb:609:in `nlst'
put_ingram.rb:69
/usr/lib/ruby/1.8/net/ftp.rb:115:in `open'
put_ingram.rb:46

davidw@twain:~$ ruby -v
ruby 1.8.4 (2005-12-24) [i486-linux]

Thanks,
Dave

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

Comment By: David Welton (davidw)
Date: 2006-11-21 04:05

Message:
I should mention that this is unfortunately not something
that happens every time with the target server.  I switched
to using passive, so that should avoid the code in question
that blocks.

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

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