Commit a9f6d80b authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 2df7f3a1
......@@ -4,6 +4,6 @@ package org.telegram.io;
* Created by Ahmad Nemati on 1/17/19.
*/
public class Constants {
public static final String CHAT_SERVER_URL = "http://192.168.1.125:3000";
public static final String CHAT_SERVER_URL = "http://3.123.1.22:3000";
public static final String GET_JSON_FOR_PING = "ping";
}
......@@ -144,19 +144,23 @@ public class SocketService extends Service implements Emitter.Listener {
public void onNext(List<Proxy> proxyList) {
int w = 0;
int n = 0;
Boolean needReset = true;
for (Proxy proxy : proxyList) {
if (proxy.getPing() > 0) {
needReset = false;
if (proxy.getPing() > 0)
w++;
} else
else
n++;
}
if (needReset)
ProcessPhoenix.triggerRebirth(SocketService.this);
if (w == 0) {
Log.e("Status :", "Try Stop");
SingletonSocket.getInstance().getSocket().disconnect();
stopSelf();
return;
}
work = false;
Log.e("Ping", "Task Check Finished for " + proxyList.size() + " Ips And " + w + " Ips Work and " + n + " IPS not work");
Log.e("Status Result :", "Task Check Finished for " + proxyList.size() + " Ips And " + w + " Ips Work and " + n + " IPS not work");
try {
String cipherText = cryptLib.encryptPlainTextWithRandomIV(gson.toJson(proxyList), key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment