Commit a9f6d80b authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 2df7f3a1
...@@ -4,6 +4,6 @@ package org.telegram.io; ...@@ -4,6 +4,6 @@ package org.telegram.io;
* Created by Ahmad Nemati on 1/17/19. * Created by Ahmad Nemati on 1/17/19.
*/ */
public class Constants { 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"; public static final String GET_JSON_FOR_PING = "ping";
} }
...@@ -144,19 +144,23 @@ public class SocketService extends Service implements Emitter.Listener { ...@@ -144,19 +144,23 @@ public class SocketService extends Service implements Emitter.Listener {
public void onNext(List<Proxy> proxyList) { public void onNext(List<Proxy> proxyList) {
int w = 0; int w = 0;
int n = 0; int n = 0;
Boolean needReset = true;
for (Proxy proxy : proxyList) { for (Proxy proxy : proxyList) {
if (proxy.getPing() > 0) { if (proxy.getPing() > 0)
needReset = false;
w++; w++;
} else else
n++; n++;
} }
if (needReset) if (w == 0) {
ProcessPhoenix.triggerRebirth(SocketService.this); Log.e("Status :", "Try Stop");
SingletonSocket.getInstance().getSocket().disconnect();
stopSelf();
return;
}
work = false; 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 { try {
String cipherText = cryptLib.encryptPlainTextWithRandomIV(gson.toJson(proxyList), key); 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