p2p2 0.7.0 → 0.7.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a02609d47ec49dddcc0200d7bb242470f30289c170bbdada5e5cc950f8b36de2
4
- data.tar.gz: 3e0a9f005faaab4d530c3923b01b5cbf898f8c6e81f4d306bad217036aadb5b0
3
+ metadata.gz: d7e54c524dd9a75718253d921b5ce39ffa471c29a5dc15244af6a68d4ae3a314
4
+ data.tar.gz: c4f4e30364b670cc8c160ab577ff75b83259bc002bb4029c7e410c322600c666
5
5
  SHA512:
6
- metadata.gz: ce008a49c906c8066fd7345b564cf69f073dc785fedca6107cca02db5f157fdf06596e24a0454942e05ed61abe92880d08bdf90d6f0382f7cf95bdad4d2f7625
7
- data.tar.gz: fc6fc4ba37580abec0c97ee57661c012fa76b2a022cd37d9ad5a5e88b7aafb4bc2a6a3de1d8a584796a07684dc6f8b6d89f0300d42bb401ae3bc14ef0864f648
6
+ metadata.gz: 892b4fc7202ccf1a9e5a3d473808dcbd55b6f8156dd1ef32253ac53aba1f49552939f787a9be8e7e425947c7b13b7a499289afee0050ed1cf142db19da875023
7
+ data.tar.gz: 6ff618b73ea3abd48df2df15a52f7b94d01658bb7bf913a6b861685d0e140116dc7b7525eb4eb6fc1ec6f0af85e8309b3afaf25af98094ce9f1563e92ab08663
@@ -1,6 +1,7 @@
1
1
  module P2p2
2
2
  PACK_SIZE = 1448 # 包大小
3
3
  CHUNK_SIZE = PACK_SIZE * 1000 # 块大小
4
+ REROOM_LIMIT = 100
4
5
  REP2P_LIMIT = 5 # p2p重试次数。到早了另一头还没从洞里出来,会吃ECONNREFUSED,不慌,再来一发。
5
6
  SET_TITLE = 1
6
7
  PAIRING = 2
@@ -123,7 +123,7 @@ module P2p2
123
123
  rescue Errno::ECONNREFUSED, EOFError, Errno::ECONNRESET => e
124
124
  puts "read room #{ e.class } #{ Time.new }"
125
125
 
126
- if @reconn_room_times >= 5
126
+ if @reconn_room_times >= REROOM_LIMIT
127
127
  raise e
128
128
  end
129
129
 
@@ -194,7 +194,7 @@ module P2p2
194
194
  rescue Errno::ECONNREFUSED, EOFError, Errno::ECONNRESET => e
195
195
  puts "read room #{ e.class } #{ Time.new }"
196
196
 
197
- if @app_info[ :reconn_room_times ] > 5
197
+ if @app_info[ :reconn_room_times ] >= REROOM_LIMIT
198
198
  raise e
199
199
  end
200
200
 
@@ -1,3 +1,3 @@
1
1
  module P2p2
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p2p2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - takafan