diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-22 12:50:23 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-22 12:50:23 +0000 |
commit | 931c0d46afa02a709ce207c7dc8932d648cf557d (patch) | |
tree | 850433382bb5a4c464bb3fa8fe8b2cee4eb73d85 /lib | |
parent | 6fc25c4e878422985d825e16aa8085d77b6a101e (diff) |
* lib/net/protocol.rb: set read_timeout dynamically.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/protocol.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb index 3b36375614..6a3441da66 100644 --- a/lib/net/protocol.rb +++ b/lib/net/protocol.rb @@ -98,7 +98,12 @@ module Net attr_reader :socket attr_accessor :open_timeout - attr_accessor :read_timeout + attr_reader :read_timeout + + def read_timeout=( sec ) + @socket.read_timeout = sec if @socket + @read_timeout = sec + end def active? @active @@ -453,6 +458,8 @@ module Net @socket.addr[3] end + attr_accessor :read_timeout + attr_reader :socket def connect( otime ) |