merge branch
This commit is contained in:
@@ -8,11 +8,11 @@ import com.mogo.commons.debug.DebugConfig;
|
||||
@Keep
|
||||
public class WebSocketConstant {
|
||||
|
||||
private static final String HOST_DEV = "ws://62.234.196.121";
|
||||
private static final String HOST_QA = "ws://62.234.196.121";
|
||||
private static final String HOST_DEMO = "ws://62.234.196.121";
|
||||
private static final String HOST_DEV = "ws://119.45.249.167";
|
||||
private static final String HOST_QA = "ws://119.45.249.167";
|
||||
private static final String HOST_DEMO = "ws://119.45.249.167";
|
||||
@Keep
|
||||
private static final String HOST_RELEASE = "ws://62.234.196.121";
|
||||
private static final String HOST_RELEASE = "ws://119.45.249.167";
|
||||
// private static final String PORT = ":14001/ws";
|
||||
@Keep
|
||||
public static final String PATH = "/ws";
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.base.websocket;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
|
||||
@@ -186,7 +187,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
|
||||
|
||||
@Override
|
||||
public void handleMessage(String message) {
|
||||
Logger.d(TAG, "websocket received msg = " + message);
|
||||
Logger.d(TAG, "websocket received msg = %s", message);
|
||||
WebSocketData webSocketData = GsonUtil.objectFromJson(message, WebSocketData.class);
|
||||
int msgType = webSocketData.getMsgType();
|
||||
Logger.d(TAG, "websocket received msg type = " + msgType);
|
||||
@@ -198,9 +199,11 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
|
||||
while (iterator.hasNext()) {
|
||||
IMogoOnWebSocketMessageListener listener = iterator.next();
|
||||
if (listener != null) {
|
||||
Logger.d(TAG, "received msgId = " + webSocketData.getSeq() + ", content = " + webSocketData.getData());
|
||||
Logger.d(TAG, "received msgId = " + webSocketData.getSeq() + ", content = %s", webSocketData.getData());
|
||||
Object receiveObj = GsonUtil.objectFromJson(webSocketData.getData(),listener.target());
|
||||
final long start = System.currentTimeMillis();
|
||||
listener.onMsgReceived(receiveObj);
|
||||
Logger.d("WebSocketManager-sdk-timer", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user