I’m using ruby 1.8.7 p334 on windows.
My code below is really simple, but there’s something wrong if the ftp
lasts for a long time:
ftp = Net::FTP.new(“18.104.22.168”)
ftp.putbinaryfile(“D:\version\XXX.cc”) # here
My destination host is very slow, so uploading a file(about 5M) can take
about 15 minutes, then ruby.exe cann’t exit forever(I see from the host
to make sure the file has been uploaded and there’s no existing
If the uploading can be finished in a few seconds, everything is OK.
I’ve tried both the 1.8.6&1.8.7 version, they behaved the same way.
I traced the raw codes in ftp.rb, and found it was stopped when
line = @sock.readline # if get EOF, raise EOFError
print "get: ", sanitize(line), “\n”
Is it because of my host not giving ruby.exe correct response, or
because of ruby itself?
Thanks a lot.