From: Fenster Blick Date: 2007-12-15T12:31:08+09:00 Subject: Re: How to maintain a single network connection? (newbie) Thanks for the reply. Unfortunately, that didn't work. However, I did end up solving the issue - after taking a break and thinking about it away from the computer. The proper way to approach the issue was to utilize a class. I should have created an instance variable for the connection in a separate Server class. In this way, I can keep a connection alive as long as a Server object is alive. I ran into difficulties when I approached the problem like a Visual Basic script... all's better now! John Pywtorak wrote: > Hi Fenster, > > I suspect it is the sftp.close stanza that is causing the problem. Try > removing that, what happens? > > Also, I would recommend using the block form of Net::SSH.start if you > can. That is > > Net::SSH.start(...) do |session| > #do all your work here, pass the session to your methods > end > > Johnny P -- Posted via http://www.ruby-forum.com/.