Commit 9bdf2647 by wjg

1.0.15

parent 9acaef06
...@@ -18,8 +18,8 @@ android { ...@@ -18,8 +18,8 @@ android {
applicationId "com.ihaoin.hooloo.device" applicationId "com.ihaoin.hooloo.device"
minSdkVersion 26 minSdkVersion 26
targetSdkVersion 30 targetSdkVersion 30
versionCode 13 versionCode 15
versionName "1.0.13" versionName "1.0.15"
ndk { ndk {
//选择要添加的对应 cpu 类型的 .so 库。 //选择要添加的对应 cpu 类型的 .so 库。
......
...@@ -10,7 +10,6 @@ public class Base { ...@@ -10,7 +10,6 @@ public class Base {
private static String SOCKET_HOST = AppConfig.DEBUG ? SOCKET_HOST_DEBUG : SOCKET_HOST_PROD; private static String SOCKET_HOST = AppConfig.DEBUG ? SOCKET_HOST_DEBUG : SOCKET_HOST_PROD;
public static final String NSP_UPGRADE = SOCKET_HOST + "/upgrade"; public static final String NSP_UPGRADE = SOCKET_HOST + "/upgrade";
public static final String NSP_KDS = SOCKET_HOST + "/kds"; public static final String NSP_KDS = SOCKET_HOST + "/kds";
public static final String NSP_INTERACTION = SOCKET_HOST + "/interaction";
public static final String NSP_MACHINE = SOCKET_HOST + "/getMachineInfo"; public static final String NSP_MACHINE = SOCKET_HOST + "/getMachineInfo";
public static final String PUSH_DEFAULT_EXTRA = "PUSH_DEFAULT_EXTRA"; public static final String PUSH_DEFAULT_EXTRA = "PUSH_DEFAULT_EXTRA";
......
...@@ -40,23 +40,10 @@ public class MachineInfoSocket extends Thread { ...@@ -40,23 +40,10 @@ public class MachineInfoSocket extends Thread {
} }
} }
private void reconnect() {
// new Handler().postDelayed(() -> {
try {
mSocket = IO.socket(Base.NSP_MACHINE);
mSocket.connect();
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
// }, 1000 * 10);
}
private Emitter.Listener onConnect = args -> Utils.i("machine socket connected"); private Emitter.Listener onConnect = args -> Utils.i("machine socket connected");
private Emitter.Listener onDisconnect = args -> { private Emitter.Listener onDisconnect = args -> {
Utils.i("machine socket disconnected"); Utils.i("machine socket disconnected");
reconnect();
}; };
public void close() { public void close() {
......
...@@ -41,18 +41,6 @@ public class KDSSocket extends Thread { ...@@ -41,18 +41,6 @@ public class KDSSocket extends Thread {
} }
} }
private void reconnect() {
// new Handler().postDelayed(() -> {
try {
mSocket = IO.socket(Base.NSP_KDS);
mSocket.connect();
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
// }, 1000 * 10);
}
private Emitter.Listener onConnect = args -> { private Emitter.Listener onConnect = args -> {
Utils.i("kds socket connected"); Utils.i("kds socket connected");
mSocket.emit("notice", "test", (Ack) ack -> Utils.i("notice: " + JsonUtils.toString(ack))); mSocket.emit("notice", "test", (Ack) ack -> Utils.i("notice: " + JsonUtils.toString(ack)));
...@@ -60,7 +48,6 @@ public class KDSSocket extends Thread { ...@@ -60,7 +48,6 @@ public class KDSSocket extends Thread {
private Emitter.Listener onDisconnect = args -> { private Emitter.Listener onDisconnect = args -> {
Utils.i("kds socket disconnected"); Utils.i("kds socket disconnected");
reconnect();
}; };
private Emitter.Listener onReply = args -> { private Emitter.Listener onReply = args -> {
......
...@@ -53,21 +53,6 @@ public class UpdateSocket extends Thread { ...@@ -53,21 +53,6 @@ public class UpdateSocket extends Thread {
} }
} }
private void reconnect() {
// new Handler().postDelayed(() -> {
try {
mSocket = IO.socket(Base.NSP_UPGRADE);
mSocket.connect();
} catch (Exception e) {
Utils.i(AppConfig.TAG_UPDATE, "连接server失败,错误原因:" + e.getMessage());
if (AppConfig.DEBUG) {
Utils.showToast(mContext, "连接server失败,错误原因:" + e.getMessage(), Toast.LENGTH_LONG);
}
e.printStackTrace();
}
// }, 1000 * 10);
}
private Emitter.Listener onConnect = args -> { private Emitter.Listener onConnect = args -> {
Utils.i(AppConfig.TAG_UPDATE, "update socket connected"); Utils.i(AppConfig.TAG_UPDATE, "update socket connected");
if (AppConfig.DEBUG) { if (AppConfig.DEBUG) {
...@@ -78,10 +63,6 @@ public class UpdateSocket extends Thread { ...@@ -78,10 +63,6 @@ public class UpdateSocket extends Thread {
private Emitter.Listener onDisconnect = args -> { private Emitter.Listener onDisconnect = args -> {
Utils.i(AppConfig.TAG_UPDATE, "update socket disconnected");; Utils.i(AppConfig.TAG_UPDATE, "update socket disconnected");;
reconnect();
if (AppConfig.DEBUG) {
Utils.showToast(mContext, "update socket, 断开连接", Toast.LENGTH_LONG);
}
}; };
private Emitter.Listener onUpgrade = args -> { private Emitter.Listener onUpgrade = args -> {
......
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