ZMQError:无法分配请求的地址 [英] ZMQError: Cannot assign requested address

查看:41
本文介绍了ZMQError:无法分配请求的地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 zeromq 开发一个动态应用程序,其操作类似于 upnp 协议(自动配置和自动发现客厅设备).为此,我使用 zeromq 来分发消息,我的问题是当我在地址 "169.254.1.0 到 169.254.254.255" 上创建套接字和绑定时,我收到这样的错误消息:ZMQError:无法分配请求的地址.

I'm using zeromq to develop a dynamic application which operate like upnp protocol( autoconfiguration and auto-discovery of equipment on a living room). To do it so, i use zeromq to distribute messages, my problem is that when i create a socket and binding on a adress "169.254.1.0 through 169.254.254.255", I receive a error messages like this: ZMQError: Cannot assign requested address.

我试图通过按本地地址 (127.0.0.1) 更改地址来找出原因,它的工作原理!问题是我正在实施 autoip,这意味着我必须在 169.254.1.0 到 169.254.254.255 范围内使用地址.

I've tried to figure out why by changing the address by local adress (127.0.0.1),and it's works !!. The problem is that i'm implementing autoip, it's means that i'm oblliged to use the adresse on range 169.254.1.0 through 169.254.254.255.

预先感谢您的帮助!

推荐答案

打开接口后,需要获取它的 IP 地址,然后绑定它.或者,您可以绑定*",表示所有接口.

After you bring the interface up, you need to get its IP address and then bind on that. Alternatively you may be able to bind on "*", meaning all interfaces.

这篇关于ZMQError:无法分配请求的地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆