ZeroMQ C++多线程服务器示例运行时错误

发布于 2024-10-05 18:18:01 字数 524 浏览 0 评论 0原文

我正在尝试运行 ZeroMQ 多线程 C++ 服务器示例,它可以通过

$ g++ server.cpp -lpthread -lzmq -o server -Wall

使用操作系统 构建良好X 10.6.5、gcc 版本 4.2.1(Apple Inc. build 5664)和 Zeromq2 的最新主分支(12 月 1 日)。但是,在启动服务器(使用 ./server)后,我立即收到运行时错误

terminate called after throwing an instance of 'zmq::error_t'
what(): Operation not supported by device

博客上提供的代码是否不再是最新的?或者我配置错误? ZMQ 似乎对我来说工作正常,否则在这台机器上(简单的请求/回复套接字模式)。

I'm trying to run the ZeroMQ multithreaded C++ server example, which builds fine with

$ g++ server.cpp -lpthread -lzmq -o server -Wall

Using OS X 10.6.5, gcc version 4.2.1 (Apple Inc. build 5664), and zeromq2's lastest master branch (Dec 1st). However I'm getting a runtime error immediately after I start the server (with ./server)

terminate called after throwing an instance of 'zmq::error_t'
what(): Operation not supported by device

Is the code provided on the blog no longer current? Or or have I misconfigured? ZMQ seems to be working fine for me otherwise on this machine (simple request/reply socket patterns).

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

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

发布评论

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

评论(1

折戟 2024-10-12 18:18:01

荒谬的。 "tcp://localhost:5555" 将失败,但 "tcp://127.0.0.1:5555" 工作正常。

更新 1:

/etc/hosts 有一个 localhost 条目,所以我不认为这是问题所在。我也尝试过使用 tcp://lo:5555 但没有成功。

Ridiculous. "tcp://localhost:5555" will fail, but "tcp://127.0.0.1:5555" works fine.

Update 1:

/etc/hosts has an entry for localhost so I don't believe that's the problem. I've also tried using tcp://lo:5555 to no success.

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