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
1596a5e8
Commit
1596a5e8
authored
Nov 07, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #743 from ricnewton/master
Add test case for many sockets
parents
998c10a1
97cfa64d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
1 deletion
+55
-1
CMakeLists.txt
CMakeLists.txt
+1
-0
Makefile.am
tests/Makefile.am
+3
-1
test_many_sockets.cpp
tests/test_many_sockets.cpp
+51
-0
No files found.
CMakeLists.txt
View file @
1596a5e8
...
...
@@ -620,6 +620,7 @@ set(tests
test_issue_566
test_shutdown_stress
test_timeo
test_many_sockets
)
if
(
NOT WIN32
)
list
(
APPEND tests
...
...
tests/Makefile.am
View file @
1596a5e8
...
...
@@ -42,7 +42,8 @@ noinst_PROGRAMS = test_system \
test_inproc_connect
\
test_issue_566
\
test_proxy
\
test_abstract_ipc
test_abstract_ipc
\
test_many_sockets
if
!ON_MINGW
noinst_PROGRAMS
+=
test_shutdown_stress
\
...
...
@@ -103,6 +104,7 @@ test_inproc_connect_SOURCES = test_inproc_connect.cpp
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
if
!ON_MINGW
test_shutdown_stress_SOURCES
=
test_shutdown_stress.cpp
test_pair_ipc_SOURCES
=
test_pair_ipc.cpp testutil.hpp
...
...
tests/test_many_sockets.cpp
0 → 100644
View file @
1596a5e8
/*
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"
#include <zmq.h>
#include <stdio.h>
#include <stdlib.h>
const
int
no_of_sockets
=
5000
;
int
main
(
void
)
{
setup_test_environment
();
void
*
ctx
=
zmq_ctx_new
();
void
*
sockets
[
no_of_sockets
];
int
sockets_created
=
0
;
for
(
int
i
=
0
;
i
<
no_of_sockets
;
++
i
)
{
sockets
[
i
]
=
zmq_socket
(
ctx
,
ZMQ_PAIR
);
if
(
sockets
[
i
])
++
sockets_created
;
}
assert
(
sockets_created
<
no_of_sockets
);
for
(
int
i
=
0
;
i
<
no_of_sockets
;
++
i
)
if
(
sockets
[
i
])
zmq_close
(
sockets
[
i
]);
zmq_ctx_destroy
(
ctx
);
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