[zeromq-dev] zpoller_wait crashes on windows

Bachmair Florian - flexSolution GmbH florian.bachmair at flexsolution.eu
Mon Oct 9 14:25:11 CEST 2017


Hello!

I updated my actors to use zpoller to handle both pipe, and reply 
sockets, it works fine under linux, but on windows it crashes when I 
call zpoller_wait.

the output on stdout is:

actor1
actor2
actor3
test 00DC5960
actor4


void rep_actor(zsock_t *pipe, void *args) {
     zsock_signal(pipe, 0);
     puts("actor1");fflush(stdout);
     zpoller_t *poller = zpoller_new(pipe, reply, NULL);
     puts("actor2");fflush(stdout);
     puts("actor3");fflush(stdout);
     bool terminated = false;
     while (!terminated) {
         puts("actor4");fflush(stdout);
         void* which = zpoller_wait(poller,-1); //CRASH!!!!!!!!!!
         printf("pipe=%p, reply=%p, which=%p", 
pipe,reply,which);fflush(stdout);
         if(which==reply){
             char* timestamp;
             char* sender;
             char* command;
             char* message;

             zsock_recv(reply, "ssss", &timestamp, &sender, &command, 
&message);

             char* result = onRequestReceived(timestamp, sender, 
command, message);
             zsock_send(reply, "s", result);

         }else if(which==pipe){
             puts("actor7");fflush(stdout);
             zmsg_t *msg = zmsg_recv(pipe);
             if(!msg)
                 break;
             char *command = zmsg_popstr(msg);
             if(streq(command, "$TERM"))
                 terminated=true;
         }
     }
}


Thanks

Florian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20171009/571ab0b9/attachment.htm>


More information about the zeromq-dev mailing list