-
Notifications
You must be signed in to change notification settings - Fork 74
JNI crash #24
Comments
The version i use is 0.8.4 |
Could you share code snippet that starts browsing? |
public class RxDnssdServiceBrowser implements IServiceBrowser {
private final static String LOCAL_DOMAIN = "local.";
private String serviceType;
private Subscription subscription;
private List<BonjourService> mServices;
public RxDnssdServiceBrowser(String serviceType) {
this.serviceType = serviceType;
this.mServices = new ArrayList<>();
}
@Override
public void startDiscover() {
RxDnssd rxDnssd = WirelessChannelApplication.getContext().getRxDnssd();
subscription = rxDnssd.browse(serviceType, LOCAL_DOMAIN)
.compose(rxDnssd.resolve())
.compose(rxDnssd.queryRecords())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<BonjourService>() {
@Override
public void call(BonjourService bonjourService) {
if (bonjourService.isLost()) {
mServices.remove(bonjourService);
} else {
mServices.remove(bonjourService);
mServices.add(bonjourService);
}
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
KLog.e(throwable);
}
});
}
@Override
public void stopDiscover() {
if (subscription != null) {
subscription.unsubscribe();
}
mServices.clear();
}
@Override
public List<BonjourService> listServices() {
return mServices;
}
} public class WirelessChannelApplication extends MultiDexApplication {
private static WirelessChannelApplication sContext;
private RxDnssd rxDnssd;
public static WirelessChannelApplication getContext() {
return sContext;
}
@Override
public void onCreate() {
super.onCreate();
sContext = this;
rxDnssd = new RxDnssdBindable(this);
}
public RxDnssd getRxDnssd() {
return rxDnssd;
}
} |
I also got
|
We ran into the same issue, but it is an API misuse issue. (But also partly a problem in how the library works.) Ultimately most A possible solution in the library would be to not give out the Another solution is to document this frequent error front and center. Developers can also keep an eye on this issue by logging |
When you make browsing you should have only 1 long-running service - actually |
Fixed in 0.9.3 |
Good work! Thanks! |
I got two kind of jni crash when use this lib, and here is the crash stack
The text was updated successfully, but these errors were encountered: