1、设置socket的recv接收操作超时时间,socket.setsockopt(ZMQ_RCVTIMEO,300);
如果设置recv 为阻塞,则不好优雅地退出线程,只能暴力退出。
2、用c语言接口,而不是c++接口。
zmq官网翻译版: https://www.cnblogs.com/fengbohello/p/4398953.html
1、设置socket的recv接收操作超时时间,socket.setsockopt(ZMQ_RCVTIMEO,300);
如果设置recv 为阻塞,则不好优雅地退出线程,只能暴力退出。
2、用c语言接口,而不是c++接口。
zmq官网翻译版: https://www.cnblogs.com/fengbohello/p/4398953.html