-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling close let other calls crash #22
Comments
By the way the method close() can block for a long time. Should may also run in a separate Runnable |
Android growing up pains are visible all over this plugin. It has not been updated for a long time and definitely improvements should be brought in, and in fact would be welcome. |
I forked the project and pushed my changes. Feel free to merge it or can/should I do that? |
Thanks for fixing this issue. If you make a pull request I'll merge it and publish an update in npm. |
Hi,
In my app I'm searching for device with ZeroConf.watch(...). After a timeout I called ZeroConf.close() to stop the service. When I now try to call the ZeroConf.watch(...) again the app crashes. The reason for that is that in ZeroConf.java the jmdns is not set to null.
Here my fix which is working:
...
} else if (action.equals("close")) {
if (jmdns != null) {
try {
jmdns.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
jmdns = null;
}
}
} else if (action.equals("unregister")) {
...
I can call unwatch and than it's working. But when I change the WLAN the I cannot find devices in the new network because we initialize the ZeroConf with an IP.
The text was updated successfully, but these errors were encountered: