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
0655ed2e
Commit
0655ed2e
authored
Apr 23, 2016
by
Doron Somech
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test unbind wildcard
parent
0934bc78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
13 deletions
+31
-13
test_unbind_wildcard.cpp
tests/test_unbind_wildcard.cpp
+31
-13
No files found.
tests/test_unbind_wildcard.cpp
View file @
0655ed2e
...
...
@@ -35,19 +35,27 @@ int main (void)
int
rc
=
zmq_bind
(
sb
,
"tcp://*:5555"
);
assert
(
rc
==
0
);
char
e
ndpoint
[
256
];
size_t
endpoint_len
=
sizeof
(
endpoint
);
rc
=
zmq_getsockopt
(
sb
,
ZMQ_LAST_ENDPOINT
,
e
ndpoint
,
&
endpoint_len
);
char
bindE
ndpoint
[
256
];
size_t
endpoint_len
=
sizeof
(
bindEndpoint
);
rc
=
zmq_getsockopt
(
sb
,
ZMQ_LAST_ENDPOINT
,
bindE
ndpoint
,
&
endpoint_len
);
assert
(
rc
==
0
);
rc
=
zmq_connect
(
sc
,
endpoint
);
char
connectEndpoint
[
256
];
#ifdef ZMQ_HAVE_WINDOWS
strcpy
(
connectEndpoint
,
"tcp://127.0.0.1:5555"
);
#else
strcpy
(
connectEndpoint
,
bindEndpoint
);
#endif
rc
=
zmq_connect
(
sc
,
connectEndpoint
);
assert
(
rc
==
0
);
bounce
(
sb
,
sc
);
rc
=
zmq_disconnect
(
sc
,
e
ndpoint
);
rc
=
zmq_disconnect
(
sc
,
connectE
ndpoint
);
assert
(
rc
==
0
);
rc
=
zmq_unbind
(
sb
,
e
ndpoint
);
rc
=
zmq_unbind
(
sb
,
bindE
ndpoint
);
assert
(
rc
==
0
);
rc
=
zmq_close
(
sc
);
...
...
@@ -68,20 +76,29 @@ int main (void)
rc
=
zmq_bind
(
sb
,
"tcp://*:5556"
);
assert
(
rc
==
0
);
endpoint_len
=
sizeof
(
bindEndpoint
);
memset
(
bindEndpoint
,
0
,
endpoint_len
);
rc
=
zmq_getsockopt
(
sb
,
ZMQ_LAST_ENDPOINT
,
bindEndpoint
,
&
endpoint_len
);
assert
(
rc
==
0
);
endpoint_len
=
sizeof
(
endpoint
);
memset
(
endpoint
,
0
,
endpoint_len
);
rc
=
zmq_getsockopt
(
sb
,
ZMQ_LAST_ENDPOINT
,
endpoint
,
&
endpoint_len
);
assert
(
rc
==
0
);
#ifdef ZMQ_HAVE_WINDOWS
if
(
ipv6
)
strcpy
(
connectEndpoint
,
"tcp://[::1]:5556"
);
else
strcpy
(
connectEndpoint
,
"tcp://127.0.0.1:5556"
);
#else
strcpy
(
connectEndpoint
,
bindEndpoint
);
#endif
rc
=
zmq_connect
(
sc
,
e
ndpoint
);
rc
=
zmq_connect
(
sc
,
connectE
ndpoint
);
assert
(
rc
==
0
);
bounce
(
sb
,
sc
);
rc
=
zmq_disconnect
(
sc
,
e
ndpoint
);
rc
=
zmq_disconnect
(
sc
,
connectE
ndpoint
);
assert
(
rc
==
0
);
rc
=
zmq_unbind
(
sb
,
e
ndpoint
);
rc
=
zmq_unbind
(
sb
,
bindE
ndpoint
);
assert
(
rc
==
0
);
rc
=
zmq_close
(
sc
);
...
...
@@ -98,6 +115,7 @@ int main (void)
rc
=
zmq_bind
(
sb
,
"tcp://127.0.0.1:*"
);
assert
(
rc
==
0
);
char
endpoint
[
256
];
endpoint_len
=
sizeof
(
endpoint
);
memset
(
endpoint
,
0
,
endpoint_len
);
rc
=
zmq_getsockopt
(
sb
,
ZMQ_LAST_ENDPOINT
,
endpoint
,
&
endpoint_len
);
...
...
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