iproto 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- data/iproto.gemspec +2 -2
- data/lib/iproto/tcp_socket.rb +12 -2
- data/lib/iproto.rb +1 -1
- metadata +8 -8
data/iproto.gemspec
CHANGED
data/lib/iproto/tcp_socket.rb
CHANGED
@@ -70,10 +70,11 @@ module IProto
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def recv_response(response_size)
|
73
|
-
socket.read(response_size) or _raise_disconnected('disconnected while read',
|
73
|
+
socket.read(response_size) or _raise_disconnected('disconnected while read', true)
|
74
74
|
end
|
75
75
|
|
76
76
|
def _raise_disconnected(message, _raise = true)
|
77
|
+
old_socket = @socket
|
77
78
|
if @reconnect
|
78
79
|
@socket = nil
|
79
80
|
@reconnect_time = Time.now + @reconnect_timeout
|
@@ -84,7 +85,16 @@ module IProto
|
|
84
85
|
when true
|
85
86
|
raise Disconnected, message
|
86
87
|
when :retry
|
87
|
-
|
88
|
+
begin
|
89
|
+
# if request were sent, then we will not have EPIPE exception
|
90
|
+
old_socket.send '\x00', 0
|
91
|
+
rescue Errno::EPIPE
|
92
|
+
# OS knows that socket is closed, and request were not sent
|
93
|
+
raise Retry
|
94
|
+
else
|
95
|
+
# OS didn't notice socket is closed, request were sent probably
|
96
|
+
raise Disconnected, message
|
97
|
+
end
|
88
98
|
end
|
89
99
|
end
|
90
100
|
end
|
data/lib/iproto.rb
CHANGED
metadata
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iproto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.11
|
5
4
|
prerelease:
|
5
|
+
version: 0.3.12
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Andrew Rudenko
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
type: :runtime
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
17
18
|
requirements:
|
18
19
|
- - ~>
|
19
20
|
- !ruby/object:Gem::Version
|
20
21
|
version: 0.0.3
|
21
|
-
|
22
|
+
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
23
25
|
requirements:
|
24
26
|
- - ~>
|
25
27
|
- !ruby/object:Gem::Version
|
26
28
|
version: 0.0.3
|
27
|
-
none: false
|
28
|
-
prerelease: false
|
29
29
|
name: bin_utils
|
30
30
|
description: Mail.Ru simple network protocol
|
31
31
|
email: ceo@prepor.ru
|
@@ -53,20 +53,20 @@ rdoc_options:
|
|
53
53
|
require_paths:
|
54
54
|
- lib
|
55
55
|
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
56
57
|
requirements:
|
57
58
|
- - ! '>='
|
58
59
|
- !ruby/object:Gem::Version
|
59
60
|
version: '0'
|
60
|
-
none: false
|
61
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
62
63
|
requirements:
|
63
64
|
- - ! '>='
|
64
65
|
- !ruby/object:Gem::Version
|
65
66
|
version: '0'
|
66
|
-
none: false
|
67
67
|
requirements: []
|
68
68
|
rubyforge_project: iproto
|
69
|
-
rubygems_version: 1.8.
|
69
|
+
rubygems_version: 1.8.23
|
70
70
|
signing_key:
|
71
71
|
specification_version: 2
|
72
72
|
summary: Mail.Ru simple network protocol
|