13 #include <nanomsg/nn.h> 14 #include <nanomsg/pair.h> 18 #define SOCKET_ADDRESS "inproc://a" 23 data_length = strlen(data);
25 bytes = nn_recv(sock, &buf, NN_MSG, 0);
26 printf (
"Socket %d EXPECTED %s RECEIVED %s [%d bytes]\n", sock, data, (
char*)buf, bytes);
35 sb = nn_socket (AF_SP, NN_PAIR);
37 sc = nn_socket (AF_SP, NN_PAIR);
40 nn_send (sc,
"ABC", 3, 0);
42 nn_send (sb,
"DEF", 3, 0);
void test_recv(int sock, const char *data)