diff options
Diffstat (limited to 'lib/net/ssh/connection/session.rb')
-rw-r--r-- | lib/net/ssh/connection/session.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/net/ssh/connection/session.rb b/lib/net/ssh/connection/session.rb index 3137514..aebd9e2 100644 --- a/lib/net/ssh/connection/session.rb +++ b/lib/net/ssh/connection/session.rb @@ -24,7 +24,10 @@ module Net; module SSH; module Connection # ssh.exec! "/etc/init.d/some_process start" # end class Session - include Constants, Loggable, Keepalive + include Constants, Loggable + + # Default IO.select timeout threshold + DEFAULT_IO_SELECT_TIMEOUT = 300 # The underlying transport layer abstraction (see Net::SSH::Transport::Session). attr_reader :transport @@ -77,7 +80,7 @@ module Net; module SSH; module Connection @max_pkt_size = (options.has_key?(:max_pkt_size) ? options[:max_pkt_size] : 0x8000) @max_win_size = (options.has_key?(:max_win_size) ? options[:max_win_size] : 0x20000) - initialize_keepalive + @keepalive = Keepalive.new(self) end # Retrieves a custom property from this instance. This can be used to @@ -242,7 +245,7 @@ module Net; module SSH; module Connection writer.send_pending end - send_keepalive_as_needed(readers, writers) + @keepalive.send_as_needed(readers, writers) transport.rekey_as_needed return true @@ -596,8 +599,8 @@ module Net; module SSH; module Connection def io_select_wait(wait) return wait if wait - return wait unless keepalive_enabled? - keepalive_interval + return wait unless @keepalive.enabled? + @keepalive.interval end MAP = Constants.constants.inject({}) do |memo, name| |