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
21f642fa
Unverified
Commit
21f642fa
authored
May 13, 2018
by
Simon Giesecke
Committed by
GitHub
May 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3092 from bluca/solaris_studio
Problem: build broken on Solaris with Sun Studio compilers
parents
15e8de2f
c5b7f4f5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
17 deletions
+36
-17
blob.hpp
src/blob.hpp
+11
-0
ctx.cpp
src/ctx.cpp
+2
-1
mechanism.cpp
src/mechanism.cpp
+2
-1
options.hpp
src/options.hpp
+2
-2
socket_base.cpp
src/socket_base.cpp
+2
-2
stream_engine.cpp
src/stream_engine.cpp
+4
-3
tcp.hpp
src/tcp.hpp
+1
-1
test_system.cpp
tests/test_system.cpp
+12
-7
No files found.
src/blob.hpp
View file @
21f642fa
...
...
@@ -40,7 +40,18 @@
#define ZMQ_PUSH_OR_EMPLACE_BACK emplace_back
#define ZMQ_MOVE(x) std::move (x)
#else
#if defined ZMQ_HAVE_SOLARIS
template
<
typename
K
,
typename
V
>
std
::
pair
<
const
K
,
V
>
make_pair_fix_const
(
const
K
&
k
,
const
V
&
v
)
{
return
std
::
pair
<
const
K
,
V
>
(
k
,
v
);
}
#define ZMQ_MAP_INSERT_OR_EMPLACE(k, v) insert (make_pair_fix_const (k, v))
#else
#define ZMQ_MAP_INSERT_OR_EMPLACE(k, v) insert (std::make_pair (k, v))
#endif
#define ZMQ_PUSH_OR_EMPLACE_BACK push_back
#define ZMQ_MOVE(x) (x)
#endif
...
...
src/ctx.cpp
View file @
21f642fa
...
...
@@ -503,7 +503,8 @@ int zmq::ctx_t::register_endpoint (const char *addr_,
scoped_lock_t
locker
(
endpoints_sync
);
const
bool
inserted
=
endpoints
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
addr_
,
endpoint_
).
second
;
endpoints
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
std
::
string
(
addr_
),
endpoint_
)
.
second
;
if
(
!
inserted
)
{
errno
=
EADDRINUSE
;
return
-
1
;
...
...
src/mechanism.cpp
View file @
21f642fa
...
...
@@ -62,7 +62,8 @@ void zmq::mechanism_t::set_user_id (const void *data_, size_t size_)
{
user_id
.
set
(
static_cast
<
const
unsigned
char
*>
(
data_
),
size_
);
zap_properties
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
ZMQ_MSG_PROPERTY_USER_ID
,
std
::
string
((
char
*
)
data_
,
size_
));
std
::
string
(
ZMQ_MSG_PROPERTY_USER_ID
),
std
::
string
((
char
*
)
data_
,
size_
));
}
const
zmq
::
blob_t
&
zmq
::
mechanism_t
::
get_user_id
()
const
...
...
src/options.hpp
View file @
21f642fa
...
...
@@ -288,11 +288,11 @@ int do_getsockopt (void *const optval_,
int
do_setsockopt_int_as_bool_strict
(
const
void
*
const
optval_
,
const
size_t
optvallen_
,
bool
*
out_value_
);
bool
*
const
out_value_
);
int
do_setsockopt_int_as_bool_relaxed
(
const
void
*
const
optval_
,
const
size_t
optvallen_
,
bool
*
out_value_
);
bool
*
const
out_value_
);
}
#endif
src/socket_base.cpp
View file @
21f642fa
...
...
@@ -783,7 +783,7 @@ int zmq::socket_base_t::connect (const char *addr_)
last_endpoint
.
assign
(
addr_
);
// remember inproc connections for disconnect
inprocs
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
addr_
,
new_pipes
[
0
]);
inprocs
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
std
::
string
(
addr_
)
,
new_pipes
[
0
]);
options
.
connected
=
true
;
return
0
;
...
...
@@ -982,7 +982,7 @@ void zmq::socket_base_t::add_endpoint (const char *addr_,
{
// Activate the session. Make it a child of this socket.
launch_child
(
endpoint_
);
endpoints
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
addr_
,
endpoints
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
std
::
string
(
addr_
)
,
endpoint_pipe_t
(
endpoint_
,
pipe
));
}
...
...
src/stream_engine.cpp
View file @
21f642fa
...
...
@@ -999,14 +999,15 @@ bool zmq::stream_engine_t::init_properties (properties_t &properties)
{
if
(
peer_address
.
empty
())
return
false
;
properties
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
ZMQ_MSG_PROPERTY_PEER_ADDRESS
,
peer_address
);
properties
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
std
::
string
(
ZMQ_MSG_PROPERTY_PEER_ADDRESS
),
peer_address
);
// Private property to support deprecated SRCFD
std
::
ostringstream
stream
;
stream
<<
(
int
)
s
;
std
::
string
fd_string
=
stream
.
str
();
properties
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
"__fd"
,
ZMQ_MOVE
(
fd_string
));
properties
.
ZMQ_MAP_INSERT_OR_EMPLACE
(
std
::
string
(
"__fd"
),
ZMQ_MOVE
(
fd_string
));
return
true
;
}
...
...
src/tcp.hpp
View file @
21f642fa
...
...
@@ -67,7 +67,7 @@ int tcp_read (fd_t s_, void *data_, size_t size_);
// on network errors such as reset or aborted connections.
void
tcp_assert_tuning_error
(
fd_t
s_
,
int
rc_
);
void
tcp_tune_loopback_fast_path
(
fd_t
socket_
);
void
tcp_tune_loopback_fast_path
(
const
fd_t
socket_
);
}
#endif
tests/test_system.cpp
View file @
21f642fa
...
...
@@ -38,6 +38,13 @@
#include <unistd.h>
#endif
// Solaris has a default of 256 max files per process
#ifdef ZMQ_HAVE_SOLARIS
#define MAX_SOCKETS 200
#else
#define MAX_SOCKETS 1000
#endif
#if defined(ZMQ_HAVE_WINDOWS)
void
initialise_network
(
void
)
...
...
@@ -75,24 +82,22 @@ int main (void)
return
-
1
;
}
// Check that we can create 1,000 sockets
int
handle
[
1000
];
int
handle
[
MAX_SOCKETS
];
int
count
;
for
(
count
=
0
;
count
<
1000
;
count
++
)
{
for
(
count
=
0
;
count
<
MAX_SOCKETS
;
count
++
)
{
handle
[
count
]
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
if
(
handle
[
count
]
==
-
1
)
{
printf
(
"W: Only able to create %d sockets on this box
\n
"
,
count
);
printf
(
"I: Tune your system to increase maximum allowed file handles
\n
"
);
#if defined(ZMQ_HAVE_OSX)
printf
(
"I: On OS/X, run 'ulimit -n 1200' in bash
\n
"
);
#elif defined(ZMQ_HAVE_LINUX)
printf
(
"I: On Linux, run 'ulimit -n 1200' in bash
\n
"
);
#if !defined(ZMQ_HAVE_WINDOWS)
printf
(
"I: Run 'ulimit -n 1200' in bash
\n
"
);
#endif
return
-
1
;
}
}
// Release the socket handles
for
(
count
=
0
;
count
<
1000
;
count
++
)
{
for
(
count
=
0
;
count
<
MAX_SOCKETS
;
count
++
)
{
close
(
handle
[
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