dango 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -297,6 +297,10 @@ class DangoServerFramework
297
297
  @session_manager.start_session() # sessionの開始処理 sidは自動生成
298
298
  sid = session[:sid]
299
299
 
300
+ session[:peer_addr] = sock.peeraddr
301
+ session[:peer_ip_adress] = sock.peeraddr[3]
302
+ session[:peer_host] = sock.peeraddr[2]
303
+
300
304
  logger.debug "thread_main:start_session. sid=#{sid} sock=#{sock} thread.current=#{Thread.current.object_id}"
301
305
 
302
306
  socket_list.add(sid, sock)
@@ -12,6 +12,7 @@ class DangoTesterClient
12
12
  ConnectionRetryTimes = 10 # 接続リトライ回数
13
13
  ConnectionRetryIntervalSec = 3 # 接続リトライ時の間隔病数
14
14
  GCIntervalSec = 5.0 # GCの発生タイミング
15
+ ReceiveCacheAutoDeleteSec = 30.0 # receive_cacheを自動で消すタイミング
15
16
 
16
17
  # テスターのイニシャライズ
17
18
  def initialize(debug = false)
@@ -33,6 +34,9 @@ class DangoTesterClient
33
34
  "host"=>serv_info["host"],
34
35
  "port"=>serv_info["port"],
35
36
  },
37
+ "tester" => {
38
+ "receive_cache_auto_delete_sec"=> serv_info["receive_cache_auto_delete_sec"] || ReceiveCacheAutoDeleteSec,
39
+ }
36
40
  }
37
41
  env = ENV['RAILS_ENV'] || 'development'
38
42
 
@@ -114,6 +118,8 @@ class TestClient < DangoClientFramework
114
118
  @config = config
115
119
  @client_name = c_name # クライアント名
116
120
 
121
+ @receive_cache_auto_delete_sec = config['tester']['receive_cache_auto_delete_sec']
122
+
117
123
  super(env, config)
118
124
 
119
125
  send_receive_shared_init()
@@ -213,6 +219,14 @@ class TestClient < DangoClientFramework
213
219
  receive_cache
214
220
  end
215
221
 
222
+ # 古いreceive_cacheを削除しておく
223
+ send_receive_shared.transaction(:receive_cache) do |receive_cache|
224
+ receive_cache.select do |one_receive_cache|
225
+ # true
226
+ one_receive_cache[2] > Time.now - @receive_cache_auto_delete_sec
227
+ end
228
+ end
229
+
216
230
  receive_data[1]
217
231
  end
218
232
 
data/lib/dango/version.rb CHANGED
@@ -2,7 +2,7 @@ module Dango #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dango
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keisuke Minami
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-05-26 00:00:00 +09:00
12
+ date: 2008-06-15 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency