Permalink
Browse files

Added test case for issue 574

  • Loading branch information...
1 parent 3e13f8c commit 9569f211ac7b0a631d70fdd297ba8ad6a7911813 @hintjens hintjens committed Nov 7, 2013
Showing with 29 additions and 0 deletions.
  1. +29 −0 574/issue.c
View
@@ -0,0 +1,29 @@
+#include <zmq.h>
+#include <stdio.h>
+#include <stdlib.h>
+int main( int nargs, char** args )
+{
+ int i, N = 1024;
+ void *ctx = zmq_ctx_new();
+ void **socks;
+ if ( nargs > 1 ) N = atoi( args[1] );
+ socks = calloc( N, sizeof( void* ));
+ printf( "Creating %i sockets\n", N );
+ for ( i = 0; i < N; ++i )
+ {
+ socks[i] = zmq_socket( ctx, ZMQ_PAIR );
+ if ( !socks[i] ) {
+ printf( "%i: %s\n", i, zmq_strerror( zmq_errno()));
+ break;
+ }
+ }
+ N = i;
+ printf( " %i sockets created\n",i );
+ for ( i = 0; i < N; ++i )
+ if ( socks[i] )
+ zmq_close( socks[i] );
+ free( socks );
+ puts( "Destroy" );
+ zmq_ctx_destroy( ctx );
+ return 0;
+}

0 comments on commit 9569f21

Please sign in to comment.