如何设置zmq套接字超时

发布于 2024-09-07 18:47:11 字数 107 浏览 0 评论 0原文

我有在 ZMQ_REQ 上下文中使用 zmq 的客户端和服务器应用程序。我遇到的情况是,当服务器组件出现故障或不可用时,客户端将等待,直到它可以发送消息。有没有办法在客户端级别设置最大等待时间或超时?

I've got client and server applications using zmq in the ZMQ_REQ context. What I'm experiencing is that when the server component goes down or is unavailable, the client will wait until it is available to send its message. Is there a way to set a max wait time or timeout at the client level?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

同展鸳鸯锦 2024-09-14 18:47:11

我猜你可以将 zmq_poll(3) 与超时大于零。

I would guess you can use the zmq_poll(3) with a timeout greater then zero.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文