Method: FileTransfer::Ftp#open_connection

Defined in:
lib/file_transfer/ftp.rb

#open_connection(conn_timeout = timeout_seconds) { ... } ⇒ Object

Opens new connection, if not already open

Parameters:

  • conn_timeout (Integer) (defaults to: timeout_seconds)

    IDLE timeout in seconds

Yields:

  • executes operation within open connection on server



94
95
96
97
98
99
# File 'lib/file_transfer/ftp.rb', line 94

def open_connection(conn_timeout = timeout_seconds)
  connect if closed?
  timeout(conn_timeout) do
    yield if block_given?
  end
end