2010-12-03 104 views
1

我试图运行ZeroMQ multithreaded C++ server example,它建立罚款ZeroMQ C++多线程服务器实例运行时错误

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

使用OS X 10.6.5,gcc版本4.2.1(苹果公司建立5664)和zeromq2的最新主分支(12月1日)。但是我得到一个运行时错误后,我开始在服务器(带./server)

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

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

回答

1

可笑。 "tcp://localhost:5555"将失败,但"tcp://127.0.0.1:5555"工作正常。

更新1:

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

+0

你的主机文件是什么样的?在最近的一些Linux发行版中,我看到主机文件没有localhost的条目,而是有一个localhost-localdomain条目。因此localhost不能解析。 – stonemetal 2010-12-03 15:21:40