otaku wrote:
> Jamis,
> 
> first thank you for responding
> 
> 
> still no luck using an even smaller code block
> and i am going over in detail the Programming Ruby section:
> Threads and Processes
> 
> http://www.ruby-doc.org/docs/ProgrammingRuby/
> 
> BEGIN CODE
> ---------
> #!/usr/local/bin/ruby
> 
> require 'thread'
> require 'net/ssh'
> require 'net/ssh/service/forward'
> 
> 
> threads = []
> 
> 
> t =  Thread.new do
> Net::SSH.start( 'localhost', 'jello', 'passwd' ) do |session|
> mgr = PortForwardManager.new( session )
> mgr.forward_local( 1236, 'remotehost', 22 )
> session.main_loop
> end
> end
> 
> Net::SSH.start( 'localhost', 1236, 'remoteuser', 'passwd' ) do
> |session|
> result = session.exec("hostname")
> puts result.data, "\n\n"
> result = session.exec("date")
> puts result.data, "\n\n"
> result = session.exec("uptime")
> puts result.data, "\n\n"
> end
> 
> threads.each { |t| t.join }
> threads.push( t )

You did the join and the push in the wrong order. You were joining on an 
empty array, which finished immediately, and then pushed the thread on, 
after which the program terminated before the thread had a chance to 
really stretch its wings.

Try reversing the order of those last two statements and see what happens.

- Jamis


-- 
Jamis Buck
jgb3 / email.byu.edu
http://www.jamisbuck.org/jamis

"I use octal until I get to 8, and then I switch to decimal."