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
6cd86932
Commit
6cd86932
authored
Jan 30, 2014
by
Richard Newton
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #863 from hintjens/master
Test for 127.0.0.1 at tests startup
parents
de96d65f
046e37e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
test_system.cpp
tests/test_system.cpp
+16
-9
No files found.
tests/test_system.cpp
View file @
6cd86932
...
...
@@ -30,36 +30,43 @@
#if defined (ZMQ_HAVE_WINDOWS)
void
initialise_network
(
)
void
initialise_network
(
void
)
{
WSADATA
info
;
if
(
WSAStartup
(
MAKEWORD
(
2
,
0
),
&
info
)
!=
0
)
{
throw
std
::
runtime_error
(
"Could not start WSA"
);
}
}
int
close
(
int
fd
)
int
close
(
int
fd
)
{
return
closesocket
(
fd
);
return
closesocket
(
fd
);
}
#else
void
initialise_network
(
)
void
initialise_network
(
void
)
{
}
#endif
// This test case stresses the system to shake out known configuration
// problems. We're
not using libzmq here but direct system calls. Note
//
that code may
need wrapping to be properly portable.
// problems. We're
direct system calls when necessary. Some code may
// need wrapping to be properly portable.
int
main
(
void
)
{
initialise_network
();
initialise_network
();
// Check that we have local networking via ZeroMQ
void
*
ctx
=
zmq_ctx_new
();
assert
(
ctx
);
void
*
dealer
=
zmq_socket
(
ctx
,
ZMQ_DEALER
);
if
(
zmq_bind
(
dealer
,
"tcp://127.0.0.1:5670"
)
==
-
1
)
{
printf
(
"E: Cannot find 127.0.0.1 -- your system does not have local
\n
"
);
printf
(
"E: networking. Please fix this before running libzmq checks.
\n
"
);
return
-
1
;
}
// Check that we can create 1,000 sockets
int
handle
[
1000
];
int
count
;
...
...
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