This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Reproduces segmentation fault in 0MQ | |
1. Start in two windows | |
myname d1 d2 | |
myname d2 d1 | |
2. Kill either instance | |
3. Other instance crashes | |
#0 0x04f6e824 in ?? () | |
#1 0x00152ac9 in zmq::session_t::activated (this=0x8054088, pipe_=0x8056598) at session.cpp:152 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Test case for issue 82 | |
// | |
#include "zhelpers.h" | |
int main () { | |
void *context = zmq_init (1); | |
s_version (); | |
char *endpoint = "tcp://*:5050"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Show inter-thread signalling using 0MQ sockets | |
// | |
#include "zhelpers.h" | |
static void * | |
child_thread (void *context) | |
{ | |
void *socket = zmq_socket (context, ZMQ_PAIR); | |
assert (zmq_connect (socket, "inproc://sink") == 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Proto1 - gateway | |
// | |
#include "zmsg.c" | |
#include "omp.h" | |
int main () | |
{ | |
void *context = zmq_init (1); | |
s_version (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exhaust file handles per process | |
#include "zmq.h" | |
#include "stdio.h" | |
int main () | |
{ | |
void *context = zmq_init (1); | |
int socket_nbr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Try to crash mailbox | |
// | |
// 1. On a single thread, have two 0mq sockets. SocketA is a PUB socket and | |
// SocketB is a SUB socket. SocketB should subscribe to everything. | |
// 2. Have SocketA do a non-blocking send for a few million messages in a | |
// tight loop. Do *not* allow SocketB any chance to recv until SocketA's | |
// loop is complete. | |
// 3. When SocketA's publishing is complete, let SocketB do a non-blocking | |
// recv until EAGAIN. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Crash mailbox... inspired by Chuck Remes | |
// | |
#include <zmq.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
// Specify any two legally combineable socket types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Crash mailbox... | |
// | |
#include <zmq.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
// Specify any two legally combineable socket types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Custom routing Router to Dealer (XREP to XREQ) | |
// | |
// Changes for 2.1: | |
// - added version assertion | |
// | |
#include "zhelpers.h" |