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
335cffc1
Commit
335cffc1
authored
Oct 28, 2013
by
Richard Newton
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #724 from hintjens/master
Renamed test_router_raw_empty to test_stream_empty
parents
ac63e562
eaba5dfe
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
34 deletions
+32
-34
.gitignore
.gitignore
+1
-0
stream.cpp
src/stream.cpp
+2
-0
Makefile.am
tests/Makefile.am
+1
-1
test_stream_empty.cpp
tests/test_stream_empty.cpp
+28
-33
No files found.
.gitignore
View file @
335cffc1
...
...
@@ -22,6 +22,7 @@ autom4te.cache
.*~
tools/curve_keygen.o
tools/curve_keygen
tests/test_stream_empty
tests/test_issue_566
tests/test_ctx_destroy
tests/test_term_endpoint
...
...
src/stream.cpp
View file @
335cffc1
...
...
@@ -142,6 +142,8 @@ int zmq::stream_t::xsend (msg_t *msg_)
current_out
->
terminate
(
false
);
int
rc
=
msg_
->
close
();
errno_assert
(
rc
==
0
);
rc
=
msg_
->
init
();
errno_assert
(
rc
==
0
);
current_out
=
NULL
;
return
0
;
}
...
...
tests/Makefile.am
View file @
335cffc1
...
...
@@ -20,9 +20,9 @@ noinst_PROGRAMS = test_system \
test_linger
\
test_monitor
\
test_router_mandatory
\
test_router_raw_empty
\
test_probe_router
\
test_stream
\
test_stream_empty
\
test_disconnect_inproc
\
test_ctx_options
\
test_ctx_destroy
\
...
...
tests/test_
router_raw
_empty.cpp
→
tests/test_
stream
_empty.cpp
View file @
335cffc1
...
...
@@ -20,46 +20,41 @@
#include "testutil.hpp"
int
main
(
void
)
{
setup_test_environment
();
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
setup_test_environment
();
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
void
*
router
=
zmq_socket
(
ctx
,
ZMQ_ROUTER
);
assert
(
router
);
void
*
dealer
=
zmq_socket
(
ctx
,
ZMQ_DEALER
);
assert
(
dealer
);
int
one
=
1
;
int
rc
=
zmq_setsockopt
(
router
,
ZMQ_ROUTER_RAW
,
&
one
,
sizeof
(
int
));
assert
(
rc
>=
0
);
rc
=
zmq_setsockopt
(
router
,
ZMQ_ROUTER_MANDATORY
,
&
one
,
sizeof
(
int
));
assert
(
rc
>=
0
);
rc
=
zmq_bind
(
router
,
"tcp://127.0.0.1:5555"
);
rc
=
zmq_connect
(
dealer
,
"tcp://127.0.0.1:5555"
);
zmq_send
(
dealer
,
""
,
0
,
0
);
void
*
stream
=
zmq_socket
(
ctx
,
ZMQ_STREAM
);
assert
(
stream
);
void
*
dealer
=
zmq_socket
(
ctx
,
ZMQ_DEALER
);
assert
(
dealer
);
int
rc
=
zmq_bind
(
stream
,
"tcp://127.0.0.1:5555"
);
assert
(
rc
>=
0
);
rc
=
zmq_connect
(
dealer
,
"tcp://127.0.0.1:5555"
);
assert
(
rc
>=
0
);
zmq_send
(
dealer
,
""
,
0
,
0
);
zmq_msg_t
ident
,
empty
;
zmq_msg_init
(
&
ident
);
rc
=
zmq_msg_recv
(
&
ident
,
router
,
0
);
assert
(
rc
>=
0
);
rc
=
zmq_msg_init_data
(
&
empty
,
(
void
*
)
""
,
0
,
NULL
,
NULL
);
assert
(
rc
>=
0
);
zmq_msg_init
(
&
ident
);
rc
=
zmq_msg_recv
(
&
ident
,
stream
,
0
);
assert
(
rc
>=
0
);
rc
=
zmq_msg_init_data
(
&
empty
,
(
void
*
)
""
,
0
,
NULL
,
NULL
);
assert
(
rc
>=
0
);
rc
=
zmq_msg_send
(
&
ident
,
router
,
ZMQ_SNDMORE
);
assert
(
rc
>=
0
);
rc
=
zmq_msg_close
(
&
ident
);
assert
(
rc
>=
0
);
rc
=
zmq_msg_send
(
&
ident
,
stream
,
ZMQ_SNDMORE
);
assert
(
rc
>=
0
);
rc
=
zmq_msg_close
(
&
ident
);
assert
(
rc
>=
0
);
rc
=
zmq_msg_send
(
&
empty
,
router
,
0
);
assert
(
rc
>=
0
);
rc
=
zmq_msg_send
(
&
empty
,
stream
,
0
);
assert
(
rc
>=
0
);
// This close used to fail with Bad Address
rc
=
zmq_msg_close
(
&
empty
);
assert
(
rc
>=
0
);
rc
=
zmq_msg_close
(
&
empty
);
assert
(
rc
>=
0
);
close_zero_linger
(
dealer
);
close_zero_linger
(
router
);
zmq_ctx_term
(
ctx
);
close_zero_linger
(
dealer
);
close_zero_linger
(
stream
);
zmq_ctx_term
(
ctx
);
}
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