cztop 0.9.4 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/lib/cztop/has_ffi_delegate.rb +8 -8
- data/lib/cztop/socket.rb +1 -0
- data/lib/cztop/version.rb +1 -1
- data/lib/cztop/zsock_options.rb +16 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 117c17b6787d700550999d0302f299aebc833902
|
4
|
+
data.tar.gz: 1b81e1fb89f114c51d9646e439d606083cd6b446
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07ed4e2fa8914018dfa2806c1df8bd10b4ba610348e96c79500edc811311fc2b4d58841cf9b5cac7d7d30d9a91219acf58f86f595fee493e4e6e02332fb6f38e
|
7
|
+
data.tar.gz: b867d2966b91bc2b371f1a61386cb0d0899047e415f9753119852a55047c9c103da1acd302af8a5ae7efaa38c18a3dc66cb6fdc75df9d05b1152c547118fe6d3
|
data/CHANGES.md
CHANGED
@@ -37,22 +37,22 @@ module CZTop::HasFFIDelegate
|
|
37
37
|
# @param msg [String] error message
|
38
38
|
# @raise [ArgumentError] if EINVAL was reported
|
39
39
|
# @raise [Interrupt] if EINTR was reported
|
40
|
-
# @raise [SocketError] if
|
40
|
+
# @raise [SocketError] if EHOSTUNREACH was reported
|
41
41
|
# @raise [SystemCallError] any other reported error (appropriate
|
42
42
|
# SystemCallError subclass, if errno is known)
|
43
43
|
def raise_zmq_err(msg = CZMQ::FFI::Errors.strerror,
|
44
44
|
errno: CZMQ::FFI::Errors.errno)
|
45
45
|
|
46
|
+
case errno
|
47
|
+
when Errno::EINVAL::Errno then raise ArgumentError, msg, caller
|
48
|
+
when Errno::EINTR::Errno then raise Interrupt, msg, caller
|
49
|
+
when Errno::EHOSTUNREACH::Errno then raise SocketError, msg, caller
|
50
|
+
|
46
51
|
# If the errno is known, the corresponding Errno::* exception is
|
47
52
|
# automatically constructed. Otherwise, it'll be a plain SystemCallError.
|
48
53
|
# In any case, #errno will return the corresponding errno.
|
49
|
-
raise SystemCallError.new(msg, errno), msg, caller
|
50
|
-
|
51
|
-
raise ArgumentError, msg, caller
|
52
|
-
rescue Errno::EINTR
|
53
|
-
raise Interrupt, msg, caller
|
54
|
-
rescue Errno::EHOSTUNREACH
|
55
|
-
raise SocketError, msg, caller
|
54
|
+
else raise SystemCallError.new(msg, errno), msg, caller
|
55
|
+
end
|
56
56
|
end
|
57
57
|
|
58
58
|
# Some class methods related to FFI delegates.
|
data/lib/cztop/socket.rb
CHANGED
@@ -15,6 +15,7 @@ module CZTop
|
|
15
15
|
# so remote clients are able to authenticate this server
|
16
16
|
# @note You'll have to use a {CZTop::Authenticator}.
|
17
17
|
# @return [void]
|
18
|
+
# @raise [ArgumentError] if there's no secret key in certificate
|
18
19
|
def CURVE_server!(cert)
|
19
20
|
options.CURVE_server = true
|
20
21
|
cert.apply(self) # NOTE: desired: raises if no secret key in cert
|
data/lib/cztop/version.rb
CHANGED
data/lib/cztop/zsock_options.rb
CHANGED
@@ -10,9 +10,23 @@ module CZTop
|
|
10
10
|
#
|
11
11
|
module ZsockOptions
|
12
12
|
# Access to the options of this socket.
|
13
|
-
# @return [OptionsAccessor]
|
13
|
+
# @return [OptionsAccessor] the memoized options accessor
|
14
14
|
def options
|
15
|
-
OptionsAccessor.new(self)
|
15
|
+
@options ||= OptionsAccessor.new(self)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Checks whether there's a message that can be read from the socket
|
19
|
+
# without blocking.
|
20
|
+
# @return [Boolean] whether the socket is readable
|
21
|
+
def readable?
|
22
|
+
(options.events & Poller::ZMQ::POLLIN) > 0
|
23
|
+
end
|
24
|
+
|
25
|
+
# Checks whether at least one message can be written to the socket without
|
26
|
+
# blocking.
|
27
|
+
# @return [Boolean] whether the socket is writable
|
28
|
+
def writable?
|
29
|
+
(options.events & Poller::ZMQ::POLLOUT) > 0
|
16
30
|
end
|
17
31
|
|
18
32
|
# Used to access the options of a {Socket} or {Actor}.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cztop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrik Wenger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: czmq-ffi-gen
|