使用zmsg_send发送消息3次后不会到达

时间:2018-04-25 13:50:51

标签: zeromq

在循环中使用zmsg_send时,前2条消息到达服务器而第3条消息没有到达。任何解决方案?

void main(void)
{
 // --------------------------------------------------------WAS MEANT SERIOUSLY:
    int            major,  minor,  patch;
    zmq_version ( &major, &minor, &patch );
    printf (                               "Current ØMQ version is %d.%d.%d\n",
                   major,  minor,  patch );
 // --------------------------------------------------------WAS MEANT SERIOUSLY

    zsock_t *client;
    zmsg_t *msg;

    client = zsock_new(ZMQ_REQ);
    zsock_connect(client, "ipc:///var/run/dummy_daemon.ipc");     
    while(true){
        msg = zmsg_new();
        zmsg_addstr(msg, "hello");
        zmsg_send(&msg, client);
        zmsg_recv(client);
    }
}

0 个答案:

没有答案