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
cca297c3
Commit
cca297c3
authored
Sep 04, 2014
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1173 from evoskuil/master
Fix configure warning.
parents
2c1d5f5a
8cd85857
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
18 deletions
+23
-18
Makefile.am
perf/Makefile.am
+2
-2
test_router_mandatory_hwm.cpp
tests/test_router_mandatory_hwm.cpp
+20
-15
Makefile.am
tools/Makefile.am
+1
-1
No files found.
perf/Makefile.am
View file @
cca297c3
INCLUDE
S
=
-I
$(top_builddir)
/include
\
-I
$(top_srcdir)
/include
AM_CPPFLAG
S
=
-I
$(top_builddir)
/include
\
-I
$(top_srcdir)
/include
noinst_PROGRAMS
=
local_lat remote_lat local_thr remote_thr inproc_lat inproc_thr
...
...
tests/test_router_mandatory_hwm.cpp
View file @
cca297c3
...
...
@@ -21,12 +21,17 @@
#include "testutil.hpp"
#include <unistd.h>
#define DEBUG 0
// DEBUG shouldn't be defined in sources as it will cause a redefined symbol
// error when it is defined in the build configuration. It appears that the
// intent here is to semi-permanently disable DEBUG tracing statements, so the
// implementation is changed to accomodate that intent.
//#define DEBUG 0
#define TRACE_ENABLED 0
int
main
(
void
)
{
int
rc
;
if
(
DEBUG
)
fprintf
(
stderr
,
"Staring router mandatory HWM test ...
\n
"
);
if
(
TRACE_ENABLED
)
fprintf
(
stderr
,
"Staring router mandatory HWM test ...
\n
"
);
setup_test_environment
();
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
...
...
@@ -72,12 +77,12 @@ int main (void)
char
buf
[
BUF_SIZE
];
// Send first batch of messages
for
(
i
=
0
;
i
<
100000
;
++
i
)
{
if
(
DEBUG
)
fprintf
(
stderr
,
"Sending message %d ...
\n
"
,
i
);
rc
=
zmq_send
(
router
,
"X"
,
1
,
ZMQ_DONTWAIT
|
ZMQ_SNDMORE
);
if
(
rc
==
-
1
&&
zmq_errno
()
==
EAGAIN
)
break
;
assert
(
rc
==
1
);
rc
=
zmq_send
(
router
,
buf
,
BUF_SIZE
,
ZMQ_DONTWAIT
);
assert
(
rc
==
BUF_SIZE
);
if
(
TRACE_ENABLED
)
fprintf
(
stderr
,
"Sending message %d ...
\n
"
,
i
);
rc
=
zmq_send
(
router
,
"X"
,
1
,
ZMQ_DONTWAIT
|
ZMQ_SNDMORE
);
if
(
rc
==
-
1
&&
zmq_errno
()
==
EAGAIN
)
break
;
assert
(
rc
==
1
);
rc
=
zmq_send
(
router
,
buf
,
BUF_SIZE
,
ZMQ_DONTWAIT
);
assert
(
rc
==
BUF_SIZE
);
}
// This should fail after one message but kernel buffering could
// skew results
...
...
@@ -85,18 +90,18 @@ int main (void)
sleep
(
1
);
// Send second batch of messages
for
(;
i
<
100000
;
++
i
)
{
if
(
DEBUG
)
fprintf
(
stderr
,
"Sending message %d (part 2) ...
\n
"
,
i
);
rc
=
zmq_send
(
router
,
"X"
,
1
,
ZMQ_DONTWAIT
|
ZMQ_SNDMORE
);
if
(
rc
==
-
1
&&
zmq_errno
()
==
EAGAIN
)
break
;
assert
(
rc
==
1
);
rc
=
zmq_send
(
router
,
buf
,
BUF_SIZE
,
ZMQ_DONTWAIT
);
assert
(
rc
==
BUF_SIZE
);
if
(
TRACE_ENABLED
)
fprintf
(
stderr
,
"Sending message %d (part 2) ...
\n
"
,
i
);
rc
=
zmq_send
(
router
,
"X"
,
1
,
ZMQ_DONTWAIT
|
ZMQ_SNDMORE
);
if
(
rc
==
-
1
&&
zmq_errno
()
==
EAGAIN
)
break
;
assert
(
rc
==
1
);
rc
=
zmq_send
(
router
,
buf
,
BUF_SIZE
,
ZMQ_DONTWAIT
);
assert
(
rc
==
BUF_SIZE
);
}
// This should fail after two messages but kernel buffering could
// skew results
assert
(
i
<
20
);
if
(
DEBUG
)
fprintf
(
stderr
,
"Done sending messages.
\n
"
);
if
(
TRACE_ENABLED
)
fprintf
(
stderr
,
"Done sending messages.
\n
"
);
rc
=
zmq_close
(
router
);
assert
(
rc
==
0
);
...
...
tools/Makefile.am
View file @
cca297c3
EXTRA_DIST
=
curve_keygen.cpp
INCLUDE
S
=
-I
$(top_srcdir)
/include
AM_CPPFLAG
S
=
-I
$(top_srcdir)
/include
bin_PROGRAMS
=
curve_keygen
...
...
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