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
bf370239
Commit
bf370239
authored
Dec 20, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed wildcard IPC endpoint and added test case
parent
62f3fdf3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
1 deletion
+62
-1
.gitignore
.gitignore
+2
-0
ipc_listener.cpp
src/ipc_listener.cpp
+3
-1
Makefile.am
tests/Makefile.am
+2
-0
test_ipc_wildcard.cpp
tests/test_ipc_wildcard.cpp
+55
-0
No files found.
.gitignore
View file @
bf370239
...
...
@@ -22,6 +22,8 @@ autom4te.cache
.*~
tools/curve_keygen.o
tools/curve_keygen
tests/test_resource
tests/test_ipc_wildcard
tests/test_stream_empty
tests/test_issue_566
tests/test_ctx_destroy
...
...
src/ipc_listener.cpp
View file @
bf370239
...
...
@@ -133,9 +133,11 @@ int zmq::ipc_listener_t::set_address (const char *addr_)
// Allow wildcard file
if
(
addr
[
0
]
==
'*'
)
{
char
buffer
[
12
]
=
"2134XXXXXX"
;
if
(
mkstemp
(
buffer
)
==
-
1
)
int
fd
=
mkstemp
(
buffer
);
if
(
fd
==
-
1
)
return
-
1
;
addr
.
assign
(
buffer
);
::
close
(
fd
);
}
// Get rid of the file associated with the UNIX domain socket that
...
...
tests/Makefile.am
View file @
bf370239
...
...
@@ -44,6 +44,7 @@ noinst_PROGRAMS = test_system \
test_proxy
\
test_abstract_ipc
\
test_many_sockets
\
test_ipc_wildcard
\
test_diffserv
if
!ON_MINGW
...
...
@@ -108,6 +109,7 @@ test_issue_566_SOURCES = test_issue_566.cpp
test_proxy_SOURCES
=
test_proxy.cpp
test_abstract_ipc_SOURCES
=
test_abstract_ipc.cpp
test_many_sockets_SOURCES
=
test_many_sockets.cpp
test_ipc_wildcard_SOURCES
=
test_ipc_wildcard.cpp
test_diffserv_SOURCES
=
test_diffserv.cpp
if
!ON_MINGW
test_shutdown_stress_SOURCES
=
test_shutdown_stress.cpp
...
...
tests/test_ipc_wildcard.cpp
0 → 100644
View file @
bf370239
/*
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
This file is part of 0MQ.
0MQ is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
0MQ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "testutil.hpp"
int
main
(
void
)
{
setup_test_environment
();
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
void
*
sb
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
assert
(
sb
);
int
rc
=
zmq_bind
(
sb
,
"ipc://*"
);
assert
(
rc
==
0
);
char
endpoint
[
200
];
size_t
size
=
sizeof
(
endpoint
);
rc
=
zmq_getsockopt
(
sb
,
ZMQ_LAST_ENDPOINT
,
endpoint
,
&
size
);
assert
(
rc
==
0
);
void
*
sc
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
assert
(
sc
);
rc
=
zmq_connect
(
sc
,
endpoint
);
assert
(
rc
==
0
);
bounce
(
sb
,
sc
);
rc
=
zmq_close
(
sc
);
assert
(
rc
==
0
);
rc
=
zmq_close
(
sb
);
assert
(
rc
==
0
);
rc
=
zmq_ctx_term
(
ctx
);
assert
(
rc
==
0
);
return
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