Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
f27c02d0
Commit
f27c02d0
authored
May 21, 2012
by
Lourens Naudé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change context monitor_event prototype to accept a va_list instead
parent
4767159f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
25 deletions
+22
-25
ctx.cpp
src/ctx.cpp
+21
-24
ctx.hpp
src/ctx.hpp
+1
-1
No files found.
src/ctx.cpp
View file @
f27c02d0
...
...
@@ -353,59 +353,56 @@ zmq::endpoint_t zmq::ctx_t::find_endpoint (const char *addr_)
return
endpoint
;
}
void
zmq
::
ctx_t
::
monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
...
)
void
zmq
::
ctx_t
::
monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
va_list
args_
)
{
if
(
monitor_fn
!=
NULL
)
{
va_list
args
;
zmq_event_data_t
data
;
memset
(
&
data
,
0
,
sizeof
(
zmq_event_data_t
));
va_start
(
args
,
event_
);
switch
(
event_
)
{
case
ZMQ_EVENT_CONNECTED
:
data
.
connected
.
addr
=
va_arg
(
args
,
char
*
);
data
.
connected
.
fd
=
va_arg
(
args
,
int
);
data
.
connected
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
connected
.
fd
=
va_arg
(
args
_
,
int
);
break
;
case
ZMQ_EVENT_CONNECT_DELAYED
:
data
.
connect_delayed
.
addr
=
va_arg
(
args
,
char
*
);
data
.
connect_delayed
.
err
=
va_arg
(
args
,
int
);
data
.
connect_delayed
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
connect_delayed
.
err
=
va_arg
(
args
_
,
int
);
break
;
case
ZMQ_EVENT_CONNECT_RETRIED
:
data
.
connect_retried
.
addr
=
va_arg
(
args
,
char
*
);
data
.
connect_retried
.
interval
=
va_arg
(
args
,
int
);
data
.
connect_retried
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
connect_retried
.
interval
=
va_arg
(
args
_
,
int
);
break
;
case
ZMQ_EVENT_LISTENING
:
data
.
listening
.
addr
=
va_arg
(
args
,
char
*
);
data
.
listening
.
fd
=
va_arg
(
args
,
int
);
data
.
listening
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
listening
.
fd
=
va_arg
(
args
_
,
int
);
break
;
case
ZMQ_EVENT_BIND_FAILED
:
data
.
bind_failed
.
addr
=
va_arg
(
args
,
char
*
);
data
.
bind_failed
.
err
=
va_arg
(
args
,
int
);
data
.
bind_failed
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
bind_failed
.
err
=
va_arg
(
args
_
,
int
);
break
;
case
ZMQ_EVENT_ACCEPTED
:
data
.
accepted
.
addr
=
va_arg
(
args
,
char
*
);
data
.
accepted
.
fd
=
va_arg
(
args
,
int
);
data
.
accepted
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
accepted
.
fd
=
va_arg
(
args
_
,
int
);
break
;
case
ZMQ_EVENT_ACCEPT_FAILED
:
data
.
accept_failed
.
addr
=
va_arg
(
args
,
char
*
);
data
.
accept_failed
.
err
=
va_arg
(
args
,
int
);
data
.
accept_failed
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
accept_failed
.
err
=
va_arg
(
args
_
,
int
);
break
;
case
ZMQ_EVENT_CLOSED
:
data
.
closed
.
addr
=
va_arg
(
args
,
char
*
);
data
.
closed
.
fd
=
va_arg
(
args
,
int
);
data
.
closed
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
closed
.
fd
=
va_arg
(
args
_
,
int
);
break
;
case
ZMQ_EVENT_CLOSE_FAILED
:
data
.
close_failed
.
addr
=
va_arg
(
args
,
char
*
);
data
.
close_failed
.
err
=
va_arg
(
args
,
int
);
data
.
close_failed
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
close_failed
.
err
=
va_arg
(
args
_
,
int
);
break
;
case
ZMQ_EVENT_DISCONNECTED
:
data
.
disconnected
.
addr
=
va_arg
(
args
,
char
*
);
data
.
disconnected
.
fd
=
va_arg
(
args
,
int
);
data
.
disconnected
.
addr
=
va_arg
(
args
_
,
char
*
);
data
.
disconnected
.
fd
=
va_arg
(
args
_
,
int
);
break
;
default
:
zmq_assert
(
false
);
}
monitor_fn
((
void
*
)
socket_
,
event_
,
&
data
);
va_end
(
args
);
}
}
...
...
src/ctx.hpp
View file @
f27c02d0
...
...
@@ -97,7 +97,7 @@ namespace zmq
// Monitoring specific
int
monitor
(
zmq_monitor_fn
*
monitor_
);
void
monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
...
);
void
monitor_event
(
zmq
::
socket_base_t
*
socket_
,
int
event_
,
va_list
args_
);
enum
{
term_tid
=
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment