Skip to content

Instantly share code, notes, and snippets.

@hintjens
Created February 25, 2011 13:39
Show Gist options
  • Save hintjens/843786 to your computer and use it in GitHub Desktop.
Save hintjens/843786 to your computer and use it in GitHub Desktop.
Runs out of file handles
//
// Socket leak test case
//
#include "zhelpers.h"
int main () {
void *context = zmq_init (1);
// Open socket, send message, close socket
// Repeat over and over
while (1) {
void *publisher = zmq_socket (context, ZMQ_PUB);
zmq_bind (publisher, "tcp://*:5555");
s_send (publisher, "Hello");
zmq_close (publisher);
}
zmq_term (context);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment