dango 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,9 +42,11 @@ class DangoClientFramework
|
|
42
42
|
@connection_client_host = @config['network']['host'] || 'localhost'
|
43
43
|
@connection_client_port = @config['network']['port'] || 15000
|
44
44
|
|
45
|
-
@connection_client_log_file
|
46
|
-
# @connection_client_log_level
|
47
|
-
@connection_client_log_level
|
45
|
+
@connection_client_log_file = "" # 未定義時にこのログファイル名を使う
|
46
|
+
# @connection_client_log_level = Logger::DEBUG # 未定義時にこのログレベルになる
|
47
|
+
@connection_client_log_level = Logger::INFO # 未定義時にこのログレベルになる
|
48
|
+
@connection_client_log_max_size = 1048576 # 未定義時にこのログレベルになる
|
49
|
+
@connection_client_log_shift_age = 99 # 未定義時にこのログレベルになる
|
48
50
|
|
49
51
|
@connection_encode_type = EncodeTypeMarshal
|
50
52
|
|
@@ -65,10 +67,10 @@ class DangoClientFramework
|
|
65
67
|
raise DangoError, message
|
66
68
|
end
|
67
69
|
|
68
|
-
@log_file
|
69
|
-
@log_level
|
70
|
-
@log_max_size
|
71
|
-
@log_shift_age =
|
70
|
+
@log_file = @connection_client_log_file
|
71
|
+
@log_level = @connection_client_log_level
|
72
|
+
@log_max_size = @connection_client_log_max_size
|
73
|
+
@log_shift_age = @connection_client_log_shift_age
|
72
74
|
|
73
75
|
# loggerの準備
|
74
76
|
logger.debug("-------client initialize host=#{@connection_client_host} port=#{@connection_client_port}")
|
data/lib/dango/framework_base.rb
CHANGED
@@ -16,7 +16,8 @@ require "kconv"
|
|
16
16
|
require "fcntl"
|
17
17
|
|
18
18
|
require "rubygems"
|
19
|
-
require
|
19
|
+
require 'json/add/rails'
|
20
|
+
|
20
21
|
|
21
22
|
require "dango/shared/memory_store.rb"
|
22
23
|
|
@@ -234,6 +235,7 @@ module DangoFrameworkModule
|
|
234
235
|
def dango_send_data(sock, send_objs, options = {})
|
235
236
|
encode_type = options[:encode_type] || DefaultEncodeType
|
236
237
|
# logger.debug "dango_send_data:sock=#{sock.inspect} encode_type=#{encode_type}"
|
238
|
+
# logger.debug "dango_send_data:send_objs=#{send_objs.inspect}"
|
237
239
|
|
238
240
|
if send_objs == []
|
239
241
|
send_data_orig = ""
|
@@ -699,7 +699,12 @@ EOF
|
|
699
699
|
# クライアントから来たハートビートの時間チェックし、古ければsocketを閉じる
|
700
700
|
if heart_beat_time_hash[sid] && heart_beat_time_hash[sid] < Time.now - @heart_beat_receive_wait_sec
|
701
701
|
logger.warn "!!!! heart_beat_thread_start:heart beat old:#{sid}:#{heart_beat_time_hash[sid]}:#{sock}:#{sock.closed?}"
|
702
|
-
sock.close if !sock.closed?
|
702
|
+
# sock.close if !sock.closed?
|
703
|
+
begin
|
704
|
+
sock.close
|
705
|
+
rescue
|
706
|
+
logger.warn "heart_beat_thread_start:failed close socket:#{error_message($!, 'u')}"
|
707
|
+
end
|
703
708
|
end
|
704
709
|
end
|
705
710
|
end
|
@@ -819,7 +824,7 @@ EOF
|
|
819
824
|
|
820
825
|
begin
|
821
826
|
logger.debug "thread_send_notice_queue:dango_send_data:sid=#{sid} sock=#{sock.inspect} #{one_send_data_list.collect{|d| d['notice'] + ','}}"
|
822
|
-
|
827
|
+
# logger.debug "thread_send_notice_queue:one_send_data_list=#{one_send_data_list.inspect}"
|
823
828
|
# logger.debug one_send_data_list.pretty_inspect
|
824
829
|
|
825
830
|
dango_send_data(sock, one_send_data_list, :type=>send_data_encode_type_list[sid]) # データ送信
|
@@ -190,8 +190,10 @@ class TestClient < DangoClientFramework
|
|
190
190
|
@connection_client_port = @config["network"]["port"] # 自動でこのポートでサーバー開始
|
191
191
|
|
192
192
|
# ログ出力情報
|
193
|
-
@connection_client_log_file = "log/tester_#{Process.pid}_#{@client_name}.log"
|
194
|
-
@connection_client_log_level = Logger::DEBUG
|
193
|
+
@connection_client_log_file = "log/tester_#{Process.pid}_#{@client_name}.log"
|
194
|
+
@connection_client_log_level = Logger::DEBUG
|
195
|
+
@connection_client_log_max_size = 10000000
|
196
|
+
@connection_client_log_shift_age = 99
|
195
197
|
end
|
196
198
|
|
197
199
|
# テストサーバー
|
data/lib/dango/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.4
|
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-07-
|
12
|
+
date: 2008-07-26 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|