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
155feccb
Commit
155feccb
authored
May 19, 2014
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1047 from mrvn/pull-testutil-expect_bounce_fail-send-timeout
Add a send timeout in expect_bounce_fail()
parents
11357df0
0ebf94e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
testutil.hpp
tests/testutil.hpp
+10
-6
No files found.
tests/testutil.hpp
View file @
155feccb
...
...
@@ -112,15 +112,17 @@ expect_bounce_fail (void *server, void *client)
{
const
char
*
content
=
"12345678ABCDEFGH12345678abcdefgh"
;
char
buffer
[
32
];
int
timeout
=
150
;
// Send message from client to server
int
rc
=
zmq_send
(
client
,
content
,
32
,
ZMQ_SNDMORE
);
assert
(
rc
==
32
);
int
rc
=
zmq_setsockopt
(
client
,
ZMQ_SNDTIMEO
,
&
timeout
,
sizeof
(
int
));
assert
(
rc
==
0
);
rc
=
zmq_send
(
client
,
content
,
32
,
ZMQ_SNDMORE
);
assert
((
rc
==
32
)
||
((
rc
==
-
1
)
&&
(
errno
==
EAGAIN
)));
rc
=
zmq_send
(
client
,
content
,
32
,
0
);
assert
(
rc
==
32
);
assert
(
(
rc
==
32
)
||
((
rc
==
-
1
)
&&
(
errno
==
EAGAIN
))
);
// Receive message at server side (should not succeed)
int
timeout
=
150
;
rc
=
zmq_setsockopt
(
server
,
ZMQ_RCVTIMEO
,
&
timeout
,
sizeof
(
int
));
assert
(
rc
==
0
);
rc
=
zmq_recv
(
server
,
buffer
,
32
,
0
);
...
...
@@ -128,10 +130,12 @@ expect_bounce_fail (void *server, void *client)
assert
(
zmq_errno
()
==
EAGAIN
);
// Send message from server to client to test other direction
rc
=
zmq_setsockopt
(
server
,
ZMQ_SNDTIMEO
,
&
timeout
,
sizeof
(
int
));
assert
(
rc
==
0
);
rc
=
zmq_send
(
server
,
content
,
32
,
ZMQ_SNDMORE
);
assert
(
rc
==
32
);
assert
(
(
rc
==
32
)
||
((
rc
==
-
1
)
&&
(
errno
==
EAGAIN
))
);
rc
=
zmq_send
(
server
,
content
,
32
,
0
);
assert
(
rc
==
32
);
assert
(
(
rc
==
32
)
||
((
rc
==
-
1
)
&&
(
errno
==
EAGAIN
))
);
// Receive message at client side (should not succeed)
rc
=
zmq_setsockopt
(
client
,
ZMQ_RCVTIMEO
,
&
timeout
,
sizeof
(
int
));
...
...
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