line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
MODULE = ZMQ::Raw PACKAGE = ZMQ::Raw::Socket |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
INCLUDE: const-xs-socket_options.inc |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
SV * |
6
|
|
|
|
|
|
|
new (class, context, type) |
7
|
|
|
|
|
|
|
SV *class |
8
|
|
|
|
|
|
|
SV *context |
9
|
|
|
|
|
|
|
int type |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
PREINIT: |
12
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
13
|
|
|
|
|
|
|
zmq_raw_context *ctx; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
CODE: |
16
|
27
|
|
|
|
|
|
ctx = ZMQ_SV_TO_PTR (Context, context); |
17
|
27
|
|
|
|
|
|
Newxz (sock, 1, zmq_raw_socket); |
18
|
27
|
|
|
|
|
|
sock->type = type; |
19
|
27
|
|
|
|
|
|
sock->socket = zmq_socket (ctx->context, type); |
20
|
27
|
|
|
|
|
|
sock->context = ctx->context; |
21
|
27
|
100
|
|
|
|
|
if (sock->socket == NULL) |
22
|
|
|
|
|
|
|
{ |
23
|
1
|
|
|
|
|
|
Safefree (sock); |
24
|
1
|
50
|
|
|
|
|
zmq_raw_check_error (-1); |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
26
|
50
|
|
|
|
|
ZMQ_NEW_OBJ_WITH_MAGIC (RETVAL, SvPVbyte_nolen (class), sock, |
28
|
|
|
|
|
|
|
SvRV (context)); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
OUTPUT: RETVAL |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
void |
33
|
|
|
|
|
|
|
bind (self, endpoint) |
34
|
|
|
|
|
|
|
SV *self |
35
|
|
|
|
|
|
|
const char *endpoint |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
PREINIT: |
38
|
|
|
|
|
|
|
int rc; |
39
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
CODE: |
42
|
12
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
43
|
12
|
|
|
|
|
|
rc = zmq_bind (sock->socket, endpoint); |
44
|
12
|
50
|
|
|
|
|
zmq_raw_check_error (rc); |
|
|
0
|
|
|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
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
void |
75
|
|
|
|
|
|
|
disconnect (self, endpoint) |
76
|
|
|
|
|
|
|
SV *self |
77
|
|
|
|
|
|
|
const char *endpoint |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
PREINIT: |
80
|
|
|
|
|
|
|
int rc; |
81
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
CODE: |
84
|
1
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
85
|
1
|
|
|
|
|
|
rc = zmq_disconnect (sock->socket, endpoint); |
86
|
1
|
50
|
|
|
|
|
zmq_raw_check_error (rc); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
void |
89
|
|
|
|
|
|
|
send (self, buffer, flags=0) |
90
|
|
|
|
|
|
|
SV *self |
91
|
|
|
|
|
|
|
SV *buffer |
92
|
|
|
|
|
|
|
int flags |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
PREINIT: |
95
|
|
|
|
|
|
|
int rc; |
96
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
PPCODE: |
99
|
26
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
100
|
26
|
|
|
|
|
|
rc = zmq_send (sock->socket, |
101
|
52
|
|
|
|
|
|
SvPVX (buffer), SvCUR (buffer), flags); |
102
|
26
|
100
|
|
|
|
|
zmq_raw_check_error (rc); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
103
|
25
|
|
|
|
|
|
XSRETURN_YES; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
void |
106
|
|
|
|
|
|
|
sendmsg (self, ...) |
107
|
|
|
|
|
|
|
SV *self |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
PREINIT: |
110
|
|
|
|
|
|
|
int rc, i; |
111
|
10
|
|
|
|
|
|
int flags = 0, count = 0; |
112
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
PPCODE: |
115
|
10
|
100
|
|
|
|
|
if (items < 2) |
116
|
1
|
|
|
|
|
|
croak_usage ("not enough parameters provided"); |
117
|
9
|
|
|
|
|
|
count = items-1; |
118
|
|
|
|
|
|
|
|
119
|
9
|
100
|
|
|
|
|
if (!sv_isobject (ST (items-1)) && SvIOK (ST (items-1))) |
|
|
100
|
|
|
|
|
|
120
|
|
|
|
|
|
|
{ |
121
|
|
|
|
|
|
|
/* the last parameter looks like 'flags'. if all the preceding |
122
|
|
|
|
|
|
|
* parameters are not ZMQ::Raw::Message objects, it is not |
123
|
|
|
|
|
|
|
* 'flags' |
124
|
|
|
|
|
|
|
*/ |
125
|
4
|
|
|
|
|
|
int is_flags = items-2 ? 1 : 0; |
126
|
10
|
50
|
|
|
|
|
for (i = 0; i < items-2; ++i && is_flags) |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
127
|
|
|
|
|
|
|
{ |
128
|
6
|
|
|
|
|
|
SV *item = ST (i+1); |
129
|
6
|
50
|
|
|
|
|
if (sv_isobject (item) && sv_derived_from (item, "ZMQ::Raw::Message")) |
|
|
50
|
|
|
|
|
|
130
|
6
|
|
|
|
|
|
continue; |
131
|
|
|
|
|
|
|
|
132
|
0
|
|
|
|
|
|
is_flags = 0; |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
4
|
50
|
|
|
|
|
if (is_flags) |
136
|
|
|
|
|
|
|
{ |
137
|
4
|
50
|
|
|
|
|
flags = (int)SvIV (ST (items-1)); |
138
|
4
|
|
|
|
|
|
--count; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
9
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
143
|
24
|
50
|
|
|
|
|
for (i = 0; i < items && count; ++i) |
|
|
100
|
|
|
|
|
|
144
|
|
|
|
|
|
|
{ |
145
|
|
|
|
|
|
|
zmq_msg_t msg; |
146
|
15
|
|
|
|
|
|
int extra = 0; |
147
|
15
|
|
|
|
|
|
SV *item = ST (i+1); |
148
|
|
|
|
|
|
|
|
149
|
15
|
100
|
|
|
|
|
if (--count > 0) |
150
|
6
|
|
|
|
|
|
extra = ZMQ_SNDMORE; |
151
|
|
|
|
|
|
|
|
152
|
15
|
100
|
|
|
|
|
if (sv_isobject (item) && sv_derived_from (item, "ZMQ::Raw::Message")) |
|
|
50
|
|
|
|
|
|
153
|
|
|
|
|
|
|
{ |
154
|
10
|
|
|
|
|
|
rc = zmq_msg_init (&msg); |
155
|
10
|
50
|
|
|
|
|
zmq_raw_check_error (rc); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
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0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
179
|
5
|
|
|
|
|
|
Copy (b, zmq_msg_data (&msg), size, char); |
180
|
5
|
|
|
|
|
|
goto SENDMSG; |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
9
|
|
|
|
|
|
XSRETURN_YES; |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
void |
187
|
|
|
|
|
|
|
recv (self, flags=0) |
188
|
|
|
|
|
|
|
SV *self |
189
|
|
|
|
|
|
|
int flags |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
PREINIT: |
192
|
|
|
|
|
|
|
int rc, ctx; |
193
|
175
|
|
|
|
|
|
int count = 0, more = 1; |
194
|
|
|
|
|
|
|
zmq_msg_t msg; |
195
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
PPCODE: |
198
|
175
|
50
|
|
|
|
|
ctx = GIMME_V; |
199
|
|
|
|
|
|
|
|
200
|
175
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|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
217
|
|
|
|
|
|
|
|
218
|
89
|
|
|
|
|
|
sv_catpvn (buffer, zmq_msg_data (&msg), zmq_msg_size (&msg)); |
219
|
|
|
|
|
|
|
|
220
|
89
|
|
|
|
|
|
more = zmq_msg_get (&msg, ZMQ_MORE); |
221
|
|
|
|
|
|
|
|
222
|
89
|
100
|
|
|
|
|
if (ctx == G_ARRAY) |
223
|
|
|
|
|
|
|
{ |
224
|
4
|
|
|
|
|
|
++count; |
225
|
4
|
50
|
|
|
|
|
XPUSHs (buffer); |
226
|
4
|
|
|
|
|
|
buffer = NULL; |
227
|
|
|
|
|
|
|
|
228
|
4
|
100
|
|
|
|
|
if (more) |
229
|
|
|
|
|
|
|
{ |
230
|
3
|
|
|
|
|
|
buffer = sv_2mortal (newSV (16)); |
231
|
3
|
|
|
|
|
|
SvPOK_on (buffer); |
232
|
3
|
|
|
|
|
|
SvCUR_set (buffer, 0); |
233
|
|
|
|
|
|
|
} |
234
|
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
} |
236
|
89
|
100
|
|
|
|
|
while (more); |
237
|
|
|
|
|
|
|
|
238
|
82
|
|
|
|
|
|
rc = zmq_msg_close (&msg); |
239
|
82
|
50
|
|
|
|
|
zmq_raw_check_error (rc); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
240
|
|
|
|
|
|
|
|
241
|
82
|
100
|
|
|
|
|
if (buffer) |
242
|
|
|
|
|
|
|
{ |
243
|
81
|
|
|
|
|
|
++count; |
244
|
81
|
50
|
|
|
|
|
XPUSHs (buffer); |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
|
247
|
175
|
|
|
|
|
|
XSRETURN (count); |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
void |
250
|
|
|
|
|
|
|
recvmsg (self, flags=0) |
251
|
|
|
|
|
|
|
SV *self |
252
|
|
|
|
|
|
|
int flags |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
PREINIT: |
255
|
|
|
|
|
|
|
int rc, ctx; |
256
|
4
|
|
|
|
|
|
int count = 0, more = 1; |
257
|
|
|
|
|
|
|
zmq_msg_t msg; |
258
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
PPCODE: |
261
|
4
|
50
|
|
|
|
|
ctx = GIMME_V; |
262
|
|
|
|
|
|
|
|
263
|
4
|
|
|
|
|
|
sock = ZMQ_SV_TO_P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
|
|
|
|
|
|
int option |
306
|
|
|
|
|
|
|
SV *value |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
PREINIT: |
309
|
|
|
|
|
|
|
int rc; |
310
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
CODE: |
313
|
13
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
314
|
|
|
|
|
|
|
|
315
|
13
|
|
|
|
|
|
switch (option) |
316
|
|
|
|
|
|
|
{ |
317
|
|
|
|
|
|
|
// int |
318
|
|
|
|
|
|
|
case ZMQ_BACKLOG: |
319
|
|
|
|
|
|
|
case ZMQ_CONFLATE: |
320
|
|
|
|
|
|
|
case ZMQ_CONNECT_TIMEOUT: |
321
|
|
|
|
|
|
|
case ZMQ_HANDSHAKE_IVL: |
322
|
|
|
|
|
|
|
case ZMQ_HEARTBEAT_IVL: |
323
|
|
|
|
|
|
|
case ZMQ_HEARTBEAT_TIMEOUT: |
324
|
|
|
|
|
|
|
case ZMQ_HEARTBEAT_TTL: |
325
|
|
|
|
|
|
|
case ZMQ_IMMEDIATE: |
326
|
|
|
|
|
|
|
case ZMQ_INVERT_MATCHING: |
327
|
|
|
|
|
|
|
case ZMQ_IPV6: |
328
|
|
|
|
|
|
|
case ZMQ_LINGER: |
329
|
|
|
|
|
|
|
case ZMQ_MULTICAST_HOPS: |
330
|
|
|
|
|
|
|
case ZMQ_MULTICAST_MAXTPDU: |
331
|
|
|
|
|
|
|
case ZMQ_PLAIN_SERVER: |
332
|
|
|
|
|
|
|
case ZMQ_USE_FD: |
333
|
|
|
|
|
|
|
case ZMQ_PROBE_ROUTER: |
334
|
|
|
|
|
|
|
case ZMQ_RATE: |
335
|
|
|
|
|
|
|
case ZMQ_RCVBUF: |
336
|
|
|
|
|
|
|
case ZMQ_RCVHWM: |
337
|
|
|
|
|
|
|
case ZMQ_RCVTIMEO: |
338
|
|
|
|
|
|
|
case ZMQ_RECONNECT_IVL: |
339
|
|
|
|
|
|
|
case ZMQ_RECONNECT_IVL_MAX: |
340
|
|
|
|
|
|
|
case ZMQ_RECOVERY_IVL: |
341
|
|
|
|
|
|
|
case ZMQ_REQ_CORRELATE: |
342
|
|
|
|
|
|
|
case ZMQ_REQ_RELAXED: |
343
|
|
|
|
|
|
|
case ZMQ_ROUTER_HANDOVER: |
344
|
|
|
|
|
|
|
case ZMQ_ROUTER_MANDATORY: |
345
|
|
|
|
|
|
|
case ZMQ_ROUTER_RAW: |
346
|
|
|
|
|
|
|
case ZMQ_SNDBUF: |
347
|
|
|
|
|
|
|
case ZMQ_SNDHWM: |
348
|
|
|
|
|
|
|
case ZMQ_SNDTIMEO: |
349
|
|
|
|
|
|
|
case ZMQ_STREAM_NOTIFY: |
350
|
|
|
|
|
|
|
case ZMQ_TCP_KEEPALIVE: |
351
|
|
|
|
|
|
|
case ZMQ_TCP_KEEPALIVE_CNT: |
352
|
|
|
|
|
|
|
case ZMQ_TCP_KEEPALIVE_IDLE: |
353
|
|
|
|
|
|
|
case ZMQ_TCP_KEEPALIVE_INTVL: |
354
|
|
|
|
|
|
|
case ZMQ_TCP_MAXRT: |
355
|
|
|
|
|
|
|
case ZMQ_TOS: |
356
|
|
|
|
|
|
|
case ZMQ_XPUB_VERBOSE: |
357
|
|
|
|
|
|
|
case ZMQ_XPUB_VERBOSER: |
358
|
|
|
|
|
|
|
case ZMQ_XPUB_MANUAL: |
359
|
|
|
|
|
|
|
case ZMQ_XPUB_NODROP: |
360
|
|
|
|
|
|
|
case ZMQ_CURVE_SERVER: |
361
|
|
|
|
|
|
|
{ |
362
|
|
|
|
|
|
|
int v; |
363
|
4
|
100
|
|
|
|
|
if (!SvIOK (value)) |
364
|
1
|
|
|
|
|
|
croak_usage ("Value is not an int"); |
365
|
|
|
|
|
|
|
|
366
|
3
|
50
|
|
|
|
|
v = (int)SvIV (value); |
367
|
3
|
|
|
|
|
|
rc = zmq_setsockopt (sock->socket, option, |
368
|
|
|
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
1
|
|
|
|
|
|
break; |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
// binary |
388
|
|
|
|
|
|
|
case ZMQ_CONNECT_RID: |
389
|
|
|
|
|
|
|
case ZMQ_IDENTITY: |
390
|
|
|
|
|
|
|
case ZMQ_PLAIN_PASSWORD: |
391
|
|
|
|
|
|
|
case ZMQ_PLAIN_USERNAME: |
392
|
|
|
|
|
|
|
case ZMQ_SOCKS_PROXY: |
393
|
|
|
|
|
|
|
case ZMQ_SUBSCRIBE: |
394
|
|
|
|
|
|
|
case ZMQ_UNSUBSCRIBE: |
395
|
|
|
|
|
|
|
case ZMQ_XPUB_WELCOME_MSG: |
396
|
|
|
|
|
|
|
case ZMQ_ZAP_DOMAIN: |
397
|
|
|
|
|
|
|
case ZMQ_TCP_ACCEPT_FILTER: |
398
|
|
|
|
|
|
|
case ZMQ_CURVE_SECRETKEY: |
399
|
|
|
|
|
|
|
case ZMQ_CURVE_PUBLICKEY: |
400
|
|
|
|
|
|
|
case ZMQ_CURVE_SERVERKEY: |
401
|
|
|
|
|
|
|
{ |
402
|
|
|
|
|
|
|
STRLEN len; |
403
|
|
|
|
|
|
|
char *buf; |
404
|
|
|
|
|
|
|
|
405
|
6
|
100
|
|
|
|
|
if (!SvPOK (value)) |
406
|
1
|
|
|
|
|
|
croak_usage ("Value is not a string"); |
407
|
|
|
|
|
|
|
|
408
|
5
|
50
|
|
|
|
|
buf = SvPV (value, len); |
409
|
5
|
|
|
|
|
|
rc = zmq_setsockopt (sock->socket, option, |
410
|
|
|
|
|
|
|
buf, len); |
411
|
5
|
50
|
|
|
|
|
zmq_raw_check_error (rc); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
412
|
|
|
|
|
|
|
} |
413
|
5
|
|
|
|
|
|
break; |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
default: |
416
|
1
|
|
|
|
|
|
croak_usage ("Unsupported option"); |
417
|
|
|
|
|
|
|
} |
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
void |
420
|
|
|
|
|
|
|
close (self) |
421
|
|
|
|
|
|
|
SV *self |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
PREINIT: |
424
|
|
|
|
|
|
|
int rc; |
425
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
CODE: |
428
|
2
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
429
|
|
|
|
|
|
|
|
430
|
2
|
100
|
|
|
|
|
if (sock->context == NULL) |
431
|
1
|
|
|
|
|
|
croak_usage ("close() cannot be called on this socket"); |
432
|
|
|
|
|
|
|
|
433
|
1
|
|
|
|
|
|
rc = zmq_close (sock->socket); |
434
|
1
|
50
|
|
|
|
|
zmq_raw_check_error (rc); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
435
|
|
|
|
|
|
|
|
436
|
1
|
|
|
|
|
|
sock->socket = zmq_socket (sock->context, sock->type); |
437
|
1
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|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
void |
457
|
|
|
|
|
|
|
join (self, group) |
458
|
|
|
|
|
|
|
SV *self |
459
|
|
|
|
|
|
|
const char *group |
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
PREINIT: |
462
|
|
|
|
|
|
|
int rc; |
463
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
CODE: |
466
|
1
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
467
|
|
|
|
|
|
|
|
468
|
1
|
|
|
|
|
|
rc = zmq_join (sock->socket, group); |
469
|
1
|
50
|
|
|
|
|
zmq_raw_check_error (rc); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
void |
472
|
|
|
|
|
|
|
leave (self, group) |
473
|
|
|
|
|
|
|
SV *self |
474
|
|
|
|
|
|
|
const char *group |
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
PREINIT: |
477
|
|
|
|
|
|
|
int rc; |
478
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
CODE: |
481
|
1
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
482
|
|
|
|
|
|
|
|
483
|
1
|
|
|
|
|
|
rc = zmq_leave (sock->socket, group); |
484
|
1
|
50
|
|
|
|
|
zmq_raw_check_error (rc); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
void |
487
|
|
|
|
|
|
|
DESTROY(self) |
488
|
|
|
|
|
|
|
SV *self |
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
PREINIT: |
491
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
492
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
CODE: |
494
|
50
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
495
|
50
|
50
|
|
|
|
|
if (sock->socket) |
496
|
50
|
|
|
|
|
|
zmq_close (sock->socket); |
497
|
50
|
|
|
|
|
|
Safefree (sock); |
498
|
50
|
|
|
|
|
|
SvREFCNT_dec (ZMQ_SV_TO_MAGIC (self)); |
499
|
|
|
|
|
|
|
|