# File lib/net/ssh/service/process/popen3.rb, line 43
          def popen3( command )
            @connection.open_channel( "session" ) do |chan|

              chan.on_success do |ch|
                input  = SSHStdinPipe.new( ch )
                output = SSHStdoutPipe.new( ch )
                error  = SSHStderrPipe.new( ch )

                if block_given?
                  yield input, output, error
                  chan.close
                else
                  return [ input, output, error ]
                end
              end

              chan.on_failure do |ch|
                chan.close
              end

              chan.exec command, true
            end

            @connection.loop
            return nil
          end