Skip to content

Commit

Permalink
Fix socket creation above sistem limits for all 'other' OS not covere…
Browse files Browse the repository at this point in the history
…d by eventfd, windows or vms; enhanced test to create sockets up to a bigger limit to really test hitting the OS limit
  • Loading branch information
davipt authored and hintjens committed Nov 19, 2013
1 parent 5d6e7a7 commit f72dbb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/signaler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (rc == -1) {
errno_assert (errno == ENFILE || errno == EMFILE);
sv [0] = sv [1] = -1;
*w_ = *r_ = -1;
return -1;
}
else {
Expand Down
3 changes: 2 additions & 1 deletion tests/test_many_sockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
#include <stdio.h>
#include <stdlib.h>

const int no_of_sockets = 5000;
const int no_of_sockets = 2 * 65536;

int main(void)
{
setup_test_environment();

void *ctx = zmq_ctx_new();
zmq_ctx_set(ctx, ZMQ_MAX_SOCKETS, no_of_sockets);
void *sockets[no_of_sockets];

int sockets_created = 0;
Expand Down

0 comments on commit f72dbb3

Please sign in to comment.