mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-19 01:43:50 +00:00
Merge pull request #749 from davipt/fix-001-test_many_sockets_and_mac_open
Fix socket creation above sistem limits for all 'other' OS not covered b...
This commit is contained in:
commit
1719b63f1d
@ -474,7 +474,7 @@ int zmq::signaler_t::make_fdpair (fd_t *r_, fd_t *w_)
|
|||||||
int rc = socketpair (AF_UNIX, SOCK_STREAM, 0, sv);
|
int rc = socketpair (AF_UNIX, SOCK_STREAM, 0, sv);
|
||||||
if (rc == -1) {
|
if (rc == -1) {
|
||||||
errno_assert (errno == ENFILE || errno == EMFILE);
|
errno_assert (errno == ENFILE || errno == EMFILE);
|
||||||
sv [0] = sv [1] = -1;
|
*w_ = *r_ = -1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -22,13 +22,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
const int no_of_sockets = 5000;
|
const int no_of_sockets = 2 * 65536;
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
setup_test_environment();
|
setup_test_environment();
|
||||||
|
|
||||||
void *ctx = zmq_ctx_new();
|
void *ctx = zmq_ctx_new();
|
||||||
|
zmq_ctx_set(ctx, ZMQ_MAX_SOCKETS, no_of_sockets);
|
||||||
void *sockets[no_of_sockets];
|
void *sockets[no_of_sockets];
|
||||||
|
|
||||||
int sockets_created = 0;
|
int sockets_created = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user