-
Notifications
You must be signed in to change notification settings - Fork 74
MulticastLock under-locked and Too many open files #59
Comments
Hi @githubforzjm For now, I would recommend the last stable version - 0.9.7. Please try this version with own wifi multicast-lock in your app. |
Please check 0.9.12 build |
@andriydruk I use 0.9.12 build in my project and it still not work use 0.9.7 has never seen this crash java.lang.RuntimeException: MulticastLock under-locked com.github.druk.dnssd.DNSSD |
@andriydruk Thanks a lot! But I found another serious issue with SAMSUNG SM-C7100. I use this phone which can discovery the service on my office network, but when I turn off Wi-Fi and turn on Wi-Fi again I could not discovery any service. I have tried to stop the discovery when the Wi-Fi was disconnected and start discovery again when the Wi-Fi reconnect to my office network, but it did not work, the only way is kill the app and reopen it. In addition, I use network service discovery (supported by Google) and the same thing happened I feel that there will be problems when wifi changes on Samsung phones. Is there any solution to this situation? Thanks. |
@githubforzjm hm, probably it can be an issue. Please try to add |
@andriydruk Thank you for your suggestion |
@githubforzjm another problem can occur with Samsung - they broke bindable version from time to time. Last time this happened in Android 4.2.1 build. Maybe they did it again. |
@andriydruk Although service discovery is a little bit slower than previous version 0.9.12, but it looks like it solves the issue by using embedded version 0.9.13. (I have to called stop discovery when phone's Wi-Fi was disconnected and start discovery again when phone's Wi-Fi reconnect to my office network) But Service is still not found when I turn off wifi and turn on wifi immediately and the phone reconnects to my office network within a few seconds. The log is as follows: If I turn off wifi and turn on wifi after a few secons (about 4~5 seconds), service discovery is normal. The log is as follows: |
I see, probably we should handle WIFI inside the library. |
Hi, Andriy Druk
First of all, thanks for your RxDNSSD open source library using Apple mDNS and the help you provided.
I have some questions that you need to confirm below:
When there are 30 services on the network, I can find these services by your library.
Then I call DNSSD.resolve and DNSSD.queryRecord to get service's ip and port.
Finally, I use ip and port to establish connection with each service using SoketChannel and it works well.
But I have some problems and need you to confirm.
Import your module to my project

Reference your library.


or
I have two issues about your library:
when I use implementation 'com.github.andriydruk:rx2dnssd:0.9.11' and I repeatly call DNSSD.browse() and DNSSDService.stop(),
after a while crash occured
java.lang.RuntimeException: MulticastLock under-locked com.github.druk.dnssd.DNSSD
at android.net.wifi.WifiManager$MulticastLock.release(WifiManager.java:2465)
at com.github.druk.dnssd.DNSSD.onServiceStopped(DNSSD.java:578)
at com.github.druk.dnssd.DNSSDBindable.onServiceStopped(DNSSDBindable.java:44)
at com.github.druk.dnssd.InternalDNSSDService.stop(InternalDNSSDService.java:21)
at com.linkplay.bonjour.presenter.LPBonjourServiceManager.stopLPBonjourDiscovery(LPBonjourServiceManager.java:187)
at com.linkplay.dnssd.DNSSDActivity.stop(DNSSDActivity.java:184)
at com.linkplay.dnssd.DNSSDActivity.access$300(DNSSDActivity.java:24)
at com.linkplay.dnssd.DNSSDActivity$5.run(DNSSDActivity.java:157)
at java.lang.Thread.run(Thread.java:831)
I believe this is caused by WifiManager.MulticastLock multicastLock in DNSSD.java
The strange thing is this crash does not happend when I use implementation project(':rx2dnssd')
when I use implementation project(':rx2dnssd') and I repeatly call DNSSD.browse() and DNSSDService.stop(),
after a while Too many open files error comes out when I establish connection with service using ip and port.
The strange thing is this error does not happend when I use implementation 'com.github.andriydruk:rx2dnssd:0.9.11'
Is there any deference between implementation 'com.github.andriydruk:rx2dnssd:0.9.11' and implementation project(':rx2dnssd')?

Because I found this:
The text was updated successfully, but these errors were encountered: