beetle 0.2.9 → 0.2.9.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.
- data/beetle.gemspec +1 -1
- data/lib/ext/qrack/client.rb +19 -18
- metadata +4 -3
data/beetle.gemspec
CHANGED
data/lib/ext/qrack/client.rb
CHANGED
@@ -1,27 +1,28 @@
|
|
1
1
|
require 'qrack/client'
|
2
2
|
|
3
|
+
unless Qrack::Client.instance_methods.include?("socket_with_reliable_timeout")
|
4
|
+
module Qrack
|
5
|
+
class Client
|
6
|
+
# overwrite the timeout method so that SystemTimer is used
|
7
|
+
# instead the standard timeout.rb: http://ph7spot.com/musings/system-timer
|
8
|
+
delegate :timeout, :to => Beetle::Timer
|
3
9
|
|
4
|
-
|
5
|
-
|
6
|
-
# overwrite the timeout method so that SystemTimer is used
|
7
|
-
# instead the standard timeout.rb: http://ph7spot.com/musings/system-timer
|
8
|
-
delegate :timeout, :to => Beetle::Timer
|
10
|
+
def socket_with_reliable_timeout
|
11
|
+
socket_without_reliable_timeout
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
secs = Integer(CONNECT_TIMEOUT)
|
14
|
-
usecs = Integer((CONNECT_TIMEOUT - secs) * 1_000_000)
|
15
|
-
optval = [secs, usecs].pack("l_2")
|
13
|
+
secs = Integer(CONNECT_TIMEOUT)
|
14
|
+
usecs = Integer((CONNECT_TIMEOUT - secs) * 1_000_000)
|
15
|
+
optval = [secs, usecs].pack("l_2")
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
begin
|
18
|
+
@socket.setsockopt Socket::SOL_SOCKET, Socket::SO_RCVTIMEO, optval
|
19
|
+
@socket.setsockopt Socket::SOL_SOCKET, Socket::SO_SNDTIMEO, optval
|
20
|
+
rescue Errno::ENOPROTOOPT
|
21
|
+
end
|
22
|
+
@socket
|
21
23
|
end
|
22
|
-
|
23
|
-
end
|
24
|
-
alias_method_chain :socket, :reliable_timeout
|
24
|
+
alias_method_chain :socket, :reliable_timeout
|
25
25
|
|
26
|
+
end
|
26
27
|
end
|
27
28
|
end
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beetle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 121
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
9
|
- 9
|
10
|
-
|
10
|
+
- 1
|
11
|
+
version: 0.2.9.1
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Stefan Kaes
|
@@ -18,7 +19,7 @@ autorequire:
|
|
18
19
|
bindir: bin
|
19
20
|
cert_chain: []
|
20
21
|
|
21
|
-
date: 2010-
|
22
|
+
date: 2010-11-15 00:00:00 +01:00
|
22
23
|
default_executable: beetle
|
23
24
|
dependencies:
|
24
25
|
- !ruby/object:Gem::Dependency
|