opt websocket
This commit is contained in:
@@ -5,10 +5,10 @@ import com.mogo.commons.debug.DebugConfig;
|
||||
|
||||
public class WebSocketConstant {
|
||||
|
||||
private static final String HOST_DEV = "ws://62.234.196.121:4001/ws";
|
||||
private static final String HOST_QA = "ws://62.234.196.121:4001/ws";
|
||||
private static final String HOST_DEMO = "ws://62.234.196.121:4001/ws";
|
||||
private static final String HOST_RELEASE = "ws://62.234.196.121:4001/ws";
|
||||
private static final String HOST_DEV = "ws://62.234.196.121:14001/ws";
|
||||
private static final String HOST_QA = "ws://62.234.196.121:14001/ws";
|
||||
private static final String HOST_DEMO = "ws://62.234.196.121:14001/ws";
|
||||
private static final String HOST_RELEASE = "ws://62.234.196.121:14001/ws";
|
||||
|
||||
public static String getSocketServer(){
|
||||
switch (DebugConfig.getNetMode()){
|
||||
|
||||
@@ -19,9 +19,8 @@ public class WebSocketHandlerThread extends HandlerThread {
|
||||
tag = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
|
||||
public void initHandler(){
|
||||
mHandler = new Handler(this.getLooper()) {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
@@ -34,6 +33,7 @@ public class WebSocketHandlerThread extends HandlerThread {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public void sendMsg(String msg) {
|
||||
if(mHandler!=null) {
|
||||
Message message = new Message();
|
||||
|
||||
@@ -35,6 +35,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
|
||||
public WebSocketManager(Context context) {
|
||||
handlerThread = new WebSocketHandlerThread(TAG);
|
||||
handlerThread.start();
|
||||
handlerThread.initHandler();
|
||||
}
|
||||
|
||||
@Keep
|
||||
@@ -154,6 +155,7 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
|
||||
@Override
|
||||
public void onConnectClose() {
|
||||
Logger.d(TAG, "websocket ready to reconnect");
|
||||
SocketClient.getInstance().getClientProxy().stop();
|
||||
SocketClient.getInstance().getClientProxy().reConnect();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user