ffi-rzmq 0.9.7 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/History.txt +9 -0
- data/lib/ffi-rzmq.rb +1 -1
- data/lib/ffi-rzmq/constants.rb +4 -0
- data/lib/ffi-rzmq/libzmq.rb +5 -2
- data/lib/ffi-rzmq/socket.rb +4 -2
- data/lib/ffi-rzmq/version.rb +1 -1
- data/spec/multipart_spec.rb +28 -0
- data/spec/socket_spec.rb +1 -1
- metadata +171 -95
data/.travis.yml
CHANGED
data/History.txt
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
== 1.0.0 / 20130109
|
2
|
+
* Fix for issue #74 (send_multiple improperly handled single part messages).
|
3
|
+
|
4
|
+
* Fix for issue #77 (unbind and disconnect).
|
5
|
+
|
6
|
+
* Fix for issue #75 (socket monitor events).
|
7
|
+
|
8
|
+
* The API is stable. Releasing 1.0.
|
9
|
+
|
1
10
|
== 0.9.7 / 20121221
|
2
11
|
* BROKE THE API.
|
3
12
|
ZMQ::Poller#register and ZMQ::Poller#deregister don't take fd argument
|
data/lib/ffi-rzmq.rb
CHANGED
data/lib/ffi-rzmq/constants.rb
CHANGED
@@ -176,6 +176,10 @@ if ZMQ::LibZMQ.version3?
|
|
176
176
|
EVENT_CLOSED = 128
|
177
177
|
EVENT_CLOSE_FAILED = 256
|
178
178
|
EVENT_DISCONNECTED = 512
|
179
|
+
EVENT_ALL = EVENT_CONNECTED | EVENT_CONNECT_DELAYED | EVENT_CONNECT_RETRIED |
|
180
|
+
EVENT_LISTENING | EVENT_BIND_FAILED | EVENT_ACCEPTED |
|
181
|
+
EVENT_ACCEPT_FAILED | EVENT_CLOSED | EVENT_CLOSE_FAILED |
|
182
|
+
EVENT_DISCONNECTED
|
179
183
|
|
180
184
|
# Socket & other errors
|
181
185
|
EMFILE = Errno::EMFILE::Errno
|
data/lib/ffi-rzmq/libzmq.rb
CHANGED
@@ -244,7 +244,8 @@ module ZMQ
|
|
244
244
|
module EventDataLayout
|
245
245
|
def self.included(base)
|
246
246
|
base.class_eval do
|
247
|
-
layout :
|
247
|
+
layout :event, :int,
|
248
|
+
:addr, :string,
|
248
249
|
:field2, :int
|
249
250
|
end
|
250
251
|
end
|
@@ -253,6 +254,8 @@ module ZMQ
|
|
253
254
|
class EventData < FFI::Struct
|
254
255
|
include EventDataLayout
|
255
256
|
|
257
|
+
def event() self[:event]; end
|
258
|
+
|
256
259
|
def addr() self[:addr]; end
|
257
260
|
alias :address :addr
|
258
261
|
|
@@ -261,7 +264,7 @@ module ZMQ
|
|
261
264
|
alias :interval :fd
|
262
265
|
|
263
266
|
def inspect
|
264
|
-
"addr [#{addr}], fd [#{fd}], field2 [#{fd}]"
|
267
|
+
"event [#{event}], addr [#{addr}], fd [#{fd}], field2 [#{fd}]"
|
265
268
|
end
|
266
269
|
|
267
270
|
def to_s; inspect; end
|
data/lib/ffi-rzmq/socket.rb
CHANGED
@@ -434,7 +434,7 @@ module ZMQ
|
|
434
434
|
-1
|
435
435
|
else
|
436
436
|
flags = NonBlocking if dontwait?(flags)
|
437
|
-
rc =
|
437
|
+
rc = 0
|
438
438
|
|
439
439
|
parts[0..-2].each do |part|
|
440
440
|
rc = send(method_name, part, (flags | ZMQ::SNDMORE))
|
@@ -637,7 +637,9 @@ module ZMQ
|
|
637
637
|
end
|
638
638
|
|
639
639
|
def self.close socket
|
640
|
-
Proc.new
|
640
|
+
Proc.new do
|
641
|
+
LibZMQ.zmq_close(socket) if socket && !socket.null?
|
642
|
+
end
|
641
643
|
end
|
642
644
|
end # class Socket for version2
|
643
645
|
|
data/lib/ffi-rzmq/version.rb
CHANGED
data/spec/multipart_spec.rb
CHANGED
@@ -5,6 +5,34 @@ module ZMQ
|
|
5
5
|
context "multipart messages" do
|
6
6
|
before(:all) { @ctx = Context.new }
|
7
7
|
after(:all) { @ctx.terminate }
|
8
|
+
|
9
|
+
context "using #send_strings" do
|
10
|
+
include APIHelper
|
11
|
+
|
12
|
+
before(:all) do
|
13
|
+
@receiver = Socket.new(@ctx.pointer, ZMQ::REP)
|
14
|
+
port = bind_to_random_tcp_port(@receiver)
|
15
|
+
|
16
|
+
@sender = Socket.new(@ctx.pointer, ZMQ::REQ)
|
17
|
+
rc = @sender.connect("tcp://127.0.0.1:#{port}")
|
18
|
+
end
|
19
|
+
|
20
|
+
after(:all) do
|
21
|
+
@sender.close
|
22
|
+
@receiver.close
|
23
|
+
end
|
24
|
+
|
25
|
+
it "correctly handles a multipart message array with 1 element" do
|
26
|
+
data = [ "1" ]
|
27
|
+
|
28
|
+
@sender.send_strings(data)
|
29
|
+
sleep 1
|
30
|
+
strings = []
|
31
|
+
rc = @receiver.recv_strings(strings)
|
32
|
+
strings.should == data
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
8
36
|
|
9
37
|
context "without identity" do
|
10
38
|
include APIHelper
|
data/spec/socket_spec.rb
CHANGED
metadata
CHANGED
@@ -1,64 +1,64 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-rzmq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.7
|
5
4
|
prerelease:
|
5
|
+
version: 1.0.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Chuck Remes
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
15
|
+
prerelease: false
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
17
|
requirements:
|
19
18
|
- - ! '>='
|
20
19
|
- !ruby/object:Gem::Version
|
21
20
|
version: '0'
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
21
|
none: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
27
|
+
none: false
|
28
|
+
name: ffi
|
29
|
+
type: :runtime
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
|
31
|
+
prerelease: false
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
33
|
requirements:
|
35
34
|
- - ~>
|
36
35
|
- !ruby/object:Gem::Version
|
37
36
|
version: '2.6'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
37
|
none: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
39
|
requirements:
|
43
40
|
- - ~>
|
44
41
|
- !ruby/object:Gem::Version
|
45
42
|
version: '2.6'
|
43
|
+
none: false
|
44
|
+
name: rspec
|
45
|
+
type: :development
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
|
47
|
+
prerelease: false
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
49
|
requirements:
|
51
50
|
- - ! '>='
|
52
51
|
- !ruby/object:Gem::Version
|
53
52
|
version: '0'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
53
|
none: false
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
55
|
requirements:
|
59
56
|
- - ! '>='
|
60
57
|
- !ruby/object:Gem::Version
|
61
58
|
version: '0'
|
59
|
+
none: false
|
60
|
+
name: rake
|
61
|
+
type: :development
|
62
62
|
description: ! 'This gem wraps the ZeroMQ networking library using the ruby FFI (foreign
|
63
63
|
|
64
64
|
function interface). It''s a pure ruby wrapper so this gem can be loaded
|
@@ -72,70 +72,134 @@ executables: []
|
|
72
72
|
extensions: []
|
73
73
|
extra_rdoc_files: []
|
74
74
|
files:
|
75
|
-
-
|
76
|
-
|
77
|
-
-
|
78
|
-
|
79
|
-
-
|
80
|
-
|
81
|
-
-
|
82
|
-
|
83
|
-
-
|
84
|
-
|
85
|
-
-
|
86
|
-
|
87
|
-
-
|
88
|
-
|
89
|
-
-
|
90
|
-
|
91
|
-
-
|
92
|
-
|
93
|
-
-
|
94
|
-
|
95
|
-
-
|
96
|
-
|
97
|
-
-
|
98
|
-
|
99
|
-
-
|
100
|
-
|
101
|
-
-
|
102
|
-
|
103
|
-
-
|
104
|
-
|
105
|
-
-
|
106
|
-
|
107
|
-
-
|
108
|
-
|
109
|
-
-
|
110
|
-
|
111
|
-
-
|
112
|
-
|
113
|
-
-
|
114
|
-
|
115
|
-
-
|
116
|
-
|
117
|
-
-
|
118
|
-
|
119
|
-
-
|
120
|
-
|
121
|
-
-
|
122
|
-
|
123
|
-
-
|
124
|
-
|
125
|
-
-
|
126
|
-
|
127
|
-
-
|
128
|
-
|
129
|
-
-
|
130
|
-
|
131
|
-
-
|
132
|
-
|
133
|
-
-
|
134
|
-
|
135
|
-
-
|
136
|
-
|
137
|
-
-
|
138
|
-
|
75
|
+
- !binary |-
|
76
|
+
LmJuc2lnbm9yZQ==
|
77
|
+
- !binary |-
|
78
|
+
LmdpdGlnbm9yZQ==
|
79
|
+
- !binary |-
|
80
|
+
LnRyYXZpcy55bWw=
|
81
|
+
- !binary |-
|
82
|
+
QVVUSE9SUy50eHQ=
|
83
|
+
- !binary |-
|
84
|
+
R2VtZmlsZQ==
|
85
|
+
- !binary |-
|
86
|
+
SGlzdG9yeS50eHQ=
|
87
|
+
- !binary |-
|
88
|
+
UkVBRE1FLnJkb2M=
|
89
|
+
- !binary |-
|
90
|
+
UmFrZWZpbGU=
|
91
|
+
- !binary |-
|
92
|
+
ZXhhbXBsZXMvUkVBRE1FLnJkb2M=
|
93
|
+
- !binary |-
|
94
|
+
ZXhhbXBsZXMvdjJhcGkvbGF0ZW5jeV9tZWFzdXJlbWVudC5yYg==
|
95
|
+
- !binary |-
|
96
|
+
ZXhhbXBsZXMvdjJhcGkvbG9jYWxfbGF0LnJi
|
97
|
+
- !binary |-
|
98
|
+
ZXhhbXBsZXMvdjJhcGkvbG9jYWxfbGF0X3BvbGwucmI=
|
99
|
+
- !binary |-
|
100
|
+
ZXhhbXBsZXMvdjJhcGkvbG9jYWxfdGhyb3VnaHB1dC5yYg==
|
101
|
+
- !binary |-
|
102
|
+
ZXhhbXBsZXMvdjJhcGkvcHViLnJi
|
103
|
+
- !binary |-
|
104
|
+
ZXhhbXBsZXMvdjJhcGkvcHVibGlzaF9zdWJzY3JpYmUucmI=
|
105
|
+
- !binary |-
|
106
|
+
ZXhhbXBsZXMvdjJhcGkvcmVtb3RlX2xhdC5yYg==
|
107
|
+
- !binary |-
|
108
|
+
ZXhhbXBsZXMvdjJhcGkvcmVtb3RlX3Rocm91Z2hwdXQucmI=
|
109
|
+
- !binary |-
|
110
|
+
ZXhhbXBsZXMvdjJhcGkvcmVxcmVwX3BvbGwucmI=
|
111
|
+
- !binary |-
|
112
|
+
ZXhhbXBsZXMvdjJhcGkvcmVxdWVzdF9yZXNwb25zZS5yYg==
|
113
|
+
- !binary |-
|
114
|
+
ZXhhbXBsZXMvdjJhcGkvc3ViLnJi
|
115
|
+
- !binary |-
|
116
|
+
ZXhhbXBsZXMvdjJhcGkvdGhyb3VnaHB1dF9tZWFzdXJlbWVudC5yYg==
|
117
|
+
- !binary |-
|
118
|
+
ZXhhbXBsZXMvdjJhcGkveHJlcXhyZXBfcG9sbC5yYg==
|
119
|
+
- !binary |-
|
120
|
+
ZXhhbXBsZXMvdjNhcGkvbGF0ZW5jeV9tZWFzdXJlbWVudC5yYg==
|
121
|
+
- !binary |-
|
122
|
+
ZXhhbXBsZXMvdjNhcGkvbG9jYWxfbGF0LnJi
|
123
|
+
- !binary |-
|
124
|
+
ZXhhbXBsZXMvdjNhcGkvbG9jYWxfbGF0X3BvbGwucmI=
|
125
|
+
- !binary |-
|
126
|
+
ZXhhbXBsZXMvdjNhcGkvbG9jYWxfdGhyb3VnaHB1dC5yYg==
|
127
|
+
- !binary |-
|
128
|
+
ZXhhbXBsZXMvdjNhcGkvcHViLnJi
|
129
|
+
- !binary |-
|
130
|
+
ZXhhbXBsZXMvdjNhcGkvcHVibGlzaF9zdWJzY3JpYmUucmI=
|
131
|
+
- !binary |-
|
132
|
+
ZXhhbXBsZXMvdjNhcGkvcmVtb3RlX2xhdC5yYg==
|
133
|
+
- !binary |-
|
134
|
+
ZXhhbXBsZXMvdjNhcGkvcmVtb3RlX3Rocm91Z2hwdXQucmI=
|
135
|
+
- !binary |-
|
136
|
+
ZXhhbXBsZXMvdjNhcGkvcmVxcmVwX3BvbGwucmI=
|
137
|
+
- !binary |-
|
138
|
+
ZXhhbXBsZXMvdjNhcGkvcmVxdWVzdF9yZXNwb25zZS5yYg==
|
139
|
+
- !binary |-
|
140
|
+
ZXhhbXBsZXMvdjNhcGkvc3ViLnJi
|
141
|
+
- !binary |-
|
142
|
+
ZXhhbXBsZXMvdjNhcGkvdGhyb3VnaHB1dF9tZWFzdXJlbWVudC5yYg==
|
143
|
+
- !binary |-
|
144
|
+
ZXhhbXBsZXMvdjNhcGkveHJlcXhyZXBfcG9sbC5yYg==
|
145
|
+
- !binary |-
|
146
|
+
ZXh0L1JFQURNRQ==
|
147
|
+
- !binary |-
|
148
|
+
ZmZpLXJ6bXEuZ2Vtc3BlYw==
|
149
|
+
- !binary |-
|
150
|
+
bGliL2ZmaS1yem1xLnJi
|
151
|
+
- !binary |-
|
152
|
+
bGliL2ZmaS1yem1xL2NvbnN0YW50cy5yYg==
|
153
|
+
- !binary |-
|
154
|
+
bGliL2ZmaS1yem1xL2NvbnRleHQucmI=
|
155
|
+
- !binary |-
|
156
|
+
bGliL2ZmaS1yem1xL2RldmljZS5yYg==
|
157
|
+
- !binary |-
|
158
|
+
bGliL2ZmaS1yem1xL2V4Y2VwdGlvbnMucmI=
|
159
|
+
- !binary |-
|
160
|
+
bGliL2ZmaS1yem1xL2xpYmMucmI=
|
161
|
+
- !binary |-
|
162
|
+
bGliL2ZmaS1yem1xL2xpYnptcS5yYg==
|
163
|
+
- !binary |-
|
164
|
+
bGliL2ZmaS1yem1xL21lc3NhZ2UucmI=
|
165
|
+
- !binary |-
|
166
|
+
bGliL2ZmaS1yem1xL3BvbGwucmI=
|
167
|
+
- !binary |-
|
168
|
+
bGliL2ZmaS1yem1xL3BvbGxfaXRlbS5yYg==
|
169
|
+
- !binary |-
|
170
|
+
bGliL2ZmaS1yem1xL3BvbGxfaXRlbXMucmI=
|
171
|
+
- !binary |-
|
172
|
+
bGliL2ZmaS1yem1xL3NvY2tldC5yYg==
|
173
|
+
- !binary |-
|
174
|
+
bGliL2ZmaS1yem1xL3V0aWwucmI=
|
175
|
+
- !binary |-
|
176
|
+
bGliL2ZmaS1yem1xL3ZlcnNpb24ucmI=
|
177
|
+
- !binary |-
|
178
|
+
bGliL2lvX2V4dGVuc2lvbnMucmI=
|
179
|
+
- !binary |-
|
180
|
+
c3BlYy9jb250ZXh0X3NwZWMucmI=
|
181
|
+
- !binary |-
|
182
|
+
c3BlYy9kZXZpY2Vfc3BlYy5yYg==
|
183
|
+
- !binary |-
|
184
|
+
c3BlYy9tZXNzYWdlX3NwZWMucmI=
|
185
|
+
- !binary |-
|
186
|
+
c3BlYy9tdWx0aXBhcnRfc3BlYy5yYg==
|
187
|
+
- !binary |-
|
188
|
+
c3BlYy9ub25ibG9ja2luZ19yZWN2X3NwZWMucmI=
|
189
|
+
- !binary |-
|
190
|
+
c3BlYy9wb2xsX3NwZWMucmI=
|
191
|
+
- !binary |-
|
192
|
+
c3BlYy9wdXNocHVsbF9zcGVjLnJi
|
193
|
+
- !binary |-
|
194
|
+
c3BlYy9yZXFyZXBfc3BlYy5yYg==
|
195
|
+
- !binary |-
|
196
|
+
c3BlYy9zb2NrZXRfc3BlYy5yYg==
|
197
|
+
- !binary |-
|
198
|
+
c3BlYy9zcGVjX2hlbHBlci5yYg==
|
199
|
+
- !binary |-
|
200
|
+
c3BlYy9zdXBwb3J0L3Rlc3QuY3J0
|
201
|
+
- !binary |-
|
202
|
+
c3BlYy9zdXBwb3J0L3Rlc3Qua2V5
|
139
203
|
homepage: http://github.com/chuckremes/ffi-rzmq
|
140
204
|
licenses: []
|
141
205
|
post_install_message:
|
@@ -143,17 +207,17 @@ rdoc_options: []
|
|
143
207
|
require_paths:
|
144
208
|
- lib
|
145
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
210
|
requirements:
|
148
211
|
- - ! '>='
|
149
212
|
- !ruby/object:Gem::Version
|
150
213
|
version: '0'
|
151
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
214
|
none: false
|
215
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
216
|
requirements:
|
154
217
|
- - ! '>='
|
155
218
|
- !ruby/object:Gem::Version
|
156
219
|
version: '0'
|
220
|
+
none: false
|
157
221
|
requirements: []
|
158
222
|
rubyforge_project: ffi-rzmq
|
159
223
|
rubygems_version: 1.8.24
|
@@ -162,15 +226,27 @@ specification_version: 3
|
|
162
226
|
summary: This gem wraps the ZeroMQ (0mq) networking library using Ruby FFI (foreign
|
163
227
|
function interface).
|
164
228
|
test_files:
|
165
|
-
-
|
166
|
-
|
167
|
-
-
|
168
|
-
|
169
|
-
-
|
170
|
-
|
171
|
-
-
|
172
|
-
|
173
|
-
-
|
174
|
-
|
175
|
-
-
|
176
|
-
|
229
|
+
- !binary |-
|
230
|
+
c3BlYy9jb250ZXh0X3NwZWMucmI=
|
231
|
+
- !binary |-
|
232
|
+
c3BlYy9kZXZpY2Vfc3BlYy5yYg==
|
233
|
+
- !binary |-
|
234
|
+
c3BlYy9tZXNzYWdlX3NwZWMucmI=
|
235
|
+
- !binary |-
|
236
|
+
c3BlYy9tdWx0aXBhcnRfc3BlYy5yYg==
|
237
|
+
- !binary |-
|
238
|
+
c3BlYy9ub25ibG9ja2luZ19yZWN2X3NwZWMucmI=
|
239
|
+
- !binary |-
|
240
|
+
c3BlYy9wb2xsX3NwZWMucmI=
|
241
|
+
- !binary |-
|
242
|
+
c3BlYy9wdXNocHVsbF9zcGVjLnJi
|
243
|
+
- !binary |-
|
244
|
+
c3BlYy9yZXFyZXBfc3BlYy5yYg==
|
245
|
+
- !binary |-
|
246
|
+
c3BlYy9zb2NrZXRfc3BlYy5yYg==
|
247
|
+
- !binary |-
|
248
|
+
c3BlYy9zcGVjX2hlbHBlci5yYg==
|
249
|
+
- !binary |-
|
250
|
+
c3BlYy9zdXBwb3J0L3Rlc3QuY3J0
|
251
|
+
- !binary |-
|
252
|
+
c3BlYy9zdXBwb3J0L3Rlc3Qua2V5
|