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
Check Server is online or not [NOT WORKING] #324
Comments
Thanks for reporting this. I'll check it. Are you sure, your server is
working and your device is connected to the network with Internet
connection? You can also check another strategy (Walled Garden)
czw., 28 lut 2019, 11:57 użytkownik Zulqurnain Haider <
notifications@github.com> napisał:
… *Server Online or Not*
it is always returning false in connectivity no matter what.
*To Reproduce*
Here is concise function i wrote to check if server is online or not.
which is not working
public void observeServerURL(){
String urlString = "http://www.someserver.com";
if(urlString == null || urlString.isEmpty())return;
InternetObservingSettings settings = InternetObservingSettings.builder()
.strategy(new SocketInternetObservingStrategy())
.host(urlString)
.timeout(2000)
.interval(10 * 1000) // each 10 seconds
.initialInterval(1000)
.build();
cpp.add(
ReactiveNetwork
.observeInternetConnectivity(settings)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
isOnline -> {
LogUtils.d("checking URL status:"+urlString+" , its online:"+isOnline);
}
},
Throwable::printStackTrace
)
);
*Smartphone (please complete the following information):*
- Device: OPPO
- OS: 5.1
- Library Version: 3.0.2
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#324>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAqcF99-mduKM_ijPDVzKcPmBrgjHpugks5vR7YggaJpZM4bWi1I>
.
|
@pwittchen yeah I've checked Walled strategy its giving same results |
Any news on this , i was going to integrate this in my app ? |
I couldn't reproduce your issue. Maybe it's an issue in your app? You can verify that by running sample projects from this repo. If they works for you, then it must be an issue with your app. Moreover, I don't know what |
Ok, I updated the code and removed that cpp.add() , because it was just a CompositeDisposable of rxjava , can you try on some test server except |
Then something may be wrong with your server. Moreover, in |
@Zulqurnain Did setting HTTP status helped in your case? |
I just got an update from my backend team, they have disabled pinging on the server, is it somehow related to the issues? |
Yes. This feature of the library pings the server. |
I have found a solution for now, below code works with my server
but the library doesn't work, rest is up to you @pwittchen, hope you can debug the issue or add the functionality for server online detect for the server who have pinging disabled. but my issue is not resolved by this library !! |
Server Online or Not
it is always returning false in connectivity no matter what.
To Reproduce
Here is concise function i wrote to check if server is online or not. which is not working
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: