Closed janckerchen closed 5 years ago
Hi, I can confirm the crash but this is a strange problem as I don't see any potential error in the code. It may be a bug of ZMQ. I would suggest you try to write the same program in C/C++ and see if it still crashes. If it is the case, you should resort to ZMQ project and you may have a better chance to get your problem solved.
It is padding problem. The size of zmq_pollitem_t in C side is 24 bytes(win64).
Adding 4 bytes padding to PollItem works for me.
struct PollItem
{
intptr_t socket;
uintptr_t fd;
short events;
short revents;
char padding[4];
bool hasInput() const {return(revents&ZMQ_POLLIN)!=0;}
bool hasOutput() const {return(revents&ZMQ_POLLOUT)!=0;}
};
I need listen the events from the socket, so I was polling socket and monitor at the same time in Update().
I dig the error step by step and provide test sourcecode
}
all test code:
test_sourcecode.zip
It confused me for a while, need help!