* lib/drb/drb.rb(DRbConn self.open): If socket pool is full, close

the socket whose last-access-time is oldest. (and add new one)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2004-07-04 16:29:03 +00:00
parent 7255981a4d
commit bc9d396610
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,8 @@
Mon Jul 5 01:20:17 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/drb/drb.rb(DRbConn self.open): If socket pool is full, close
the socket whose last-access-time is oldest. (and add new one)
Sun Jul 4 12:24:50 2004 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/rss.rb: added copyright header.

View File

@ -1080,11 +1080,14 @@ module DRb
return succ, result
ensure
@mutex.synchronize do
if @pool.size > POOL_SIZE or ! succ
conn.close if conn
if conn
if succ
@mutex.synchronize do
@pool.unshift(conn)
@pool.pop.close while @pool.size > POOL_SIZE
end
else
@pool.unshift(conn)
conn.close
end
end
end