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
|
28
|
|
|
|
|
|
ctx = ZMQ_SV_TO_PTR (Context, context); |
17
|
28
|
|
|
|
|
|
Newxz (sock, 1, zmq_raw_socket); |
18
|
28
|
|
|
|
|
|
sock->type = type; |
19
|
28
|
|
|
|
|
|
sock->socket = zmq_socket (ctx->context, type); |
20
|
28
|
|
|
|
|
|
sock->context = ctx->context; |
21
|
28
|
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
|
27
|
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
|
13
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
43
|
13
|
|
|
|
|
|
rc = zmq_bind (sock->socket, endpoint); |
44
|
13
|
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_ROUTER_NOTIFY: |
347
|
|
|
|
|
|
|
case ZMQ_SNDBUF: |
348
|
|
|
|
|
|
|
case ZMQ_SNDHWM: |
349
|
|
|
|
|
|
|
case ZMQ_SNDTIMEO: |
350
|
|
|
|
|
|
|
case ZMQ_STREAM_NOTIFY: |
351
|
|
|
|
|
|
|
case ZMQ_TCP_KEEPALIVE: |
352
|
|
|
|
|
|
|
case ZMQ_TCP_KEEPALIVE_CNT: |
353
|
|
|
|
|
|
|
case ZMQ_TCP_KEEPALIVE_IDLE: |
354
|
|
|
|
|
|
|
case ZMQ_TCP_KEEPALIVE_INTVL: |
355
|
|
|
|
|
|
|
case ZMQ_TCP_MAXRT: |
356
|
|
|
|
|
|
|
case ZMQ_TOS: |
357
|
|
|
|
|
|
|
case ZMQ_XPUB_VERBOSE: |
358
|
|
|
|
|
|
|
case ZMQ_XPUB_VERBOSER: |
359
|
|
|
|
|
|
|
case ZMQ_XPUB_MANUAL: |
360
|
|
|
|
|
|
|
case ZMQ_XPUB_NODROP: |
361
|
|
|
|
|
|
|
case ZMQ_CURVE_SERVER: |
362
|
|
|
|
|
|
|
{ |
363
|
|
|
|
|
|
|
int v; |
364
|
4
|
100
|
|
|
|
|
if (!SvIOK (value)) |
365
|
1
|
|
|
|
|
|
croak_usage ("Value is not an int"); |
366
|
|
|
|
|
|
|
|
367
|
3
|
50
|
|
|
|
|
v = (int)SvIV (value); |
368
|
3
|
|
|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377
|
|
|
|
|
|
|
int64_t v; |
378
|
2
|
100
|
|
|
|
|
if (!SvIOK (value)) |
379
|
1
|
|
|
|
|
|
croak_usage ("Value is not an int"); |
380
|
|
|
|
|
|
|
|
381
|
1
|
50
|
|
|
|
|
v = SvIV (value); |
382
|
1
|
|
|
|
|
|
rc = zmq_setsockopt (sock->socket, option, |
383
|
|
|
|
|
|
|
&v, sizeof (v)); |
384
|
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
|
|
|
|
|
|
385
|
|
|
|
|
|
|
} |
386
|
1
|
|
|
|
|
|
break; |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
// binary |
389
|
|
|
|
|
|
|
case ZMQ_CONNECT_RID: |
390
|
|
|
|
|
|
|
case ZMQ_ROUTING_ID: |
391
|
|
|
|
|
|
|
case ZMQ_PLAIN_PASSWORD: |
392
|
|
|
|
|
|
|
case ZMQ_PLAIN_USERNAME: |
393
|
|
|
|
|
|
|
case ZMQ_SOCKS_PROXY: |
394
|
|
|
|
|
|
|
case ZMQ_SUBSCRIBE: |
395
|
|
|
|
|
|
|
case ZMQ_UNSUBSCRIBE: |
396
|
|
|
|
|
|
|
case ZMQ_XPUB_WELCOME_MSG: |
397
|
|
|
|
|
|
|
case ZMQ_ZAP_DOMAIN: |
398
|
|
|
|
|
|
|
case ZMQ_TCP_ACCEPT_FILTER: |
399
|
|
|
|
|
|
|
case ZMQ_CURVE_SECRETKEY: |
400
|
|
|
|
|
|
|
case ZMQ_CURVE_PUBLICKEY: |
401
|
|
|
|
|
|
|
case ZMQ_CURVE_SERVERKEY: |
402
|
|
|
|
|
|
|
{ |
403
|
|
|
|
|
|
|
STRLEN len; |
404
|
|
|
|
|
|
|
char *buf; |
405
|
|
|
|
|
|
|
|
406
|
6
|
100
|
|
|
|
|
if (!SvPOK (value)) |
407
|
1
|
|
|
|
|
|
croak_usage ("Value is not a string"); |
408
|
|
|
|
|
|
|
|
409
|
5
|
50
|
|
|
|
|
buf = SvPV (value, len); |
410
|
5
|
|
|
|
|
|
rc = zmq_setsockopt (sock->socket, option, |
411
|
|
|
|
|
|
|
buf, len); |
412
|
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
|
|
|
|
|
|
413
|
|
|
|
|
|
|
} |
414
|
5
|
|
|
|
|
|
break; |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
default: |
417
|
1
|
|
|
|
|
|
croak_usage ("Unsupported option"); |
418
|
|
|
|
|
|
|
} |
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
void |
421
|
|
|
|
|
|
|
close (self) |
422
|
|
|
|
|
|
|
SV *self |
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
PREINIT: |
425
|
|
|
|
|
|
|
int rc; |
426
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
CODE: |
429
|
2
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
430
|
|
|
|
|
|
|
|
431
|
2
|
100
|
|
|
|
|
if (sock->context == NULL) |
432
|
1
|
|
|
|
|
|
croak_usage ("close() cannot be called on this socket"); |
433
|
|
|
|
|
|
|
|
434
|
1
|
|
|
|
|
|
rc = zmq_close (sock->socket); |
435
|
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
|
|
|
|
|
|
436
|
|
|
|
|
|
|
|
437
|
1
|
|
|
|
|
|
sock->socket = zmq_socket (sock->context, sock->type); |
438
|
1
|
50
|
|
|
|
|
if (sock->socket == NULL) |
439
|
0
|
0
|
|
|
|
|
zmq_raw_check_error (-1); |
|
|
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
|
|
|
|
|
|
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
void |
442
|
|
|
|
|
|
|
monitor (self, endpoint, events) |
443
|
|
|
|
|
|
|
SV *self |
444
|
|
|
|
|
|
|
const char *endpoint |
445
|
|
|
|
|
|
|
int events |
446
|
|
|
|
|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|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
void |
458
|
|
|
|
|
|
|
join (self, group) |
459
|
|
|
|
|
|
|
SV *self |
460
|
|
|
|
|
|
|
const char *group |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
PREINIT: |
463
|
|
|
|
|
|
|
int rc; |
464
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
CODE: |
467
|
1
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
468
|
|
|
|
|
|
|
|
469
|
1
|
|
|
|
|
|
rc = zmq_join (sock->socket, group); |
470
|
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
|
|
|
|
|
|
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
void |
473
|
|
|
|
|
|
|
leave (self, group) |
474
|
|
|
|
|
|
|
SV *self |
475
|
|
|
|
|
|
|
const char *group |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
PREINIT: |
478
|
|
|
|
|
|
|
int rc; |
479
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
CODE: |
482
|
1
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
483
|
|
|
|
|
|
|
|
484
|
1
|
|
|
|
|
|
rc = zmq_leave (sock->socket, group); |
485
|
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
|
|
|
|
|
|
486
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
void |
488
|
|
|
|
|
|
|
DESTROY(self) |
489
|
|
|
|
|
|
|
SV *self |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
PREINIT: |
492
|
|
|
|
|
|
|
zmq_raw_socket *sock; |
493
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
CODE: |
495
|
51
|
|
|
|
|
|
sock = ZMQ_SV_TO_PTR (Socket, self); |
496
|
51
|
50
|
|
|
|
|
if (sock->socket) |
497
|
51
|
|
|
|
|
|
zmq_close (sock->socket); |
498
|
51
|
|
|
|
|
|
Safefree (sock); |
499
|
51
|
|
|
|
|
|
SvREFCNT_dec (ZMQ_SV_TO_MAGIC (self)); |
500
|
|
|
|
|
|
|
|