No services discovered after network break

  • Erwin Zwart

    Erwin Zwart - 2013-01-17

    Hi we are using the latest and greatest development version of the JmDns library and we are facing a problem that we don't receive any packets after pulling and reconnecting  the network cable (also with the latest stable one). Actually that is, the listener is not called any more (addServiceListener). When adding a log message in the Socketlistener (line 3818 in the socket.recieve line) we see that there are packets received but simply our registered listener is not called anymore!

    So it looks like we do receive something but appearantly the jmdns library don't think its appropiate in order to call the listeners?

    Also stopping and starting the application, remove/addlistener , reinitializing and the Jmdns library and setting the date way back (clearing cache?) does not resolve this state. Only a reboot of the device will recover it.

    Is this something anyone has seen before? Does anyone know a how to (properly) recover?

    We are using an Android platform with 2.3.3 (gingerbread)

  • Erwin Zwart

    Erwin Zwart - 2013-01-17

    Sorry some additional information about the correct sequence to reproduce this:

    1) create JmDns by JmDNS.create(data.inetAddress);
    2) addlistener to receive updates by calling jmDNS.addServiceListener(data.listenerType, data.listener);

    we receive the updates as expected
    No disconnect the cable (and wait until the eth adapter also indicates that the connection is down)

    3) stop receiving the updates by calling jmDNS.removeServiceListener(data.listenerType, data.listener);
    4) stop the JmDns library by calling jmDNS.close();

    reconnect the ethernet cable

    From now (when we follow steps 1 and 2) we don't reveive any updates anymore (eg listeners are not called). We DON'T (as contradiction in my previous post) receive ANY packets other then about 10 packets from the local host?

    hopefully this gives some more info,

  • Erwin Zwart

    Erwin Zwart - 2013-01-28

    Despite that this forum is as good as dead, perhaps it good use to someone experiencing somewhat similar.

    The problem is that we are using Zeroconfig and link-local address thus next to the standard ethernet adapter also a link-local adapter. So we have an interfaces on eth0: wich is using static/dhcp addres and the other one is using a link local address (

    When creating JmDns with a specific ip address:
    JmDNS create(192.168.x.x, ""); it will listen to that interface only and receive mdns queries on that. Same goes for when u are using a link-local.

    When creating JmDns with 'null' as the address it will pick the first local address available....So the binding will be... a guess (whatever interface comes first).

    When we bind to the dhcp/static address (first adapter found) all works fine and we receive mdns clients. When network connection failure occurs the adapter will dissappear and appear again, making the link-local interface the first in the list! Now we are lost....cause there is no way to recover (the link-local address will alway be the first one) then a reboot (causing hopefully that the static/dhcp interface will become the first again).

    The 'problem' of link local being the first adapter is that it will only receive clients within the link-local address range(also according bug 54 )

    The fix I would suggest is to prefer a non-link-local address above the link-local... when your creating an JmDns instance with null as the parameter OR dissallow 'null' as parameter for the address.

    anny thoughts or comments would be more then welcome.....


Log in to post a comment.