Search code examples
zeromq

ZMQError: Cannot assign requested address


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.

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.

Thanks in advance for your help!


Solution

  • 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.