Ticket #39122: patch-tests-test_disconnect_inproc.cpp.diff
File patch-tests-test_disconnect_inproc.cpp.diff, 1.3 KB (added by jdgleeson, 12 years ago) |
---|
-
tests/test_disconnect_inproc.cpp
old new 40 40 zmq_msg_t msg; 41 41 zmq_msg_init (&msg); 42 42 zmq_msg_recv (&msg, pubSocket, 0); 43 int msgSize = zmq_msg_size(&msg);44 43 char* buffer = (char*)zmq_msg_data(&msg); 45 44 46 45 if (buffer[0] == 0) { 47 46 assert(isSubscribed); 48 printf("unsubscribing from '%s'\n", strndup(buffer + 1, msgSize - 1));49 47 isSubscribed = false; 50 } else { 48 } 49 else { 51 50 assert(!isSubscribed); 52 printf("subscribing on '%s'\n", strndup(buffer + 1, msgSize - 1));53 51 isSubscribed = true; 54 52 } 55 53 … … 66 64 zmq_msg_t msg; 67 65 zmq_msg_init (&msg); 68 66 zmq_msg_recv (&msg, subSocket, 0); 69 int msgSize = zmq_msg_size(&msg);70 char* buffer = (char*)zmq_msg_data(&msg);71 72 printf("received on subscriber '%s'\n", strndup(buffer, msgSize));73 74 67 zmq_getsockopt (subSocket, ZMQ_RCVMORE, &more, &more_size); 75 68 zmq_msg_close (&msg); 76 69