// Path: app/src/main/java/com/demo/amazing/net/config/WSErrorCode.java
// public interface WSErrorCode {
// 
//     int NO_ERROR = 0;
// 
//     int CANCEL = 1;
// 
//     int SUCCESS = 200;
// 
//     int NET_CLOSE = 404;
// 
//     int BROKEN = 1000;
// 
//     int WS_URL_NOT_EXIST = 1001;
// }
// 
// Path: app/src/main/java/com/demo/amazing/util/LogUtil.java
// public class LogUtil {
// 
//     public static void e(String msg) {
//         Log.e("free", msg);
//     }
// 
//     public static void d(String tag, String msg) {
//         Log.e("free", msg);
//     }
// }


import com.demo.amazing.net.config.WSErrorCode;
import com.demo.amazing.util.LogUtil;
import okhttp3.Response;
import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import okio.ByteString;
package com.demo.amazing.net;



/**
 * Created by hzsunyj on 2017/8/28.
 */

public class WSListener extends WebSocketListener {

    WSCallBack callBack;

    public WSListener(WSCallBack callBack) {
        this.callBack = callBack;
    }

    @Override
    public void onOpen(WebSocket webSocket, Response response) {
        callBack.isConnected();
        LogUtil.e("client onOpen");
    }

    @Override
// Path: app/src/main/java/com/demo/amazing/net/config/WSErrorCode.java
// public interface WSErrorCode {
// 
//     int NO_ERROR = 0;
// 
//     int CANCEL = 1;
// 
//     int SUCCESS = 200;
// 
//     int NET_CLOSE = 404;
// 
//     int BROKEN = 1000;
// 
//     int WS_URL_NOT_EXIST = 1001;
// }
// 
// Path: app/src/main/java/com/demo/amazing/util/LogUtil.java
// public class LogUtil {
// 
//     public static void e(String msg) {
//         Log.e("free", msg);
//     }
// 
//     public static void d(String tag, String msg) {
//         Log.e("free", msg);
//     }
// }


// Path: app/src/main/java/com/demo/amazing/net/WSListener.java
import com.demo.amazing.net.config.WSErrorCode;
import com.demo.amazing.util.LogUtil;
import okhttp3.Response;
import okhttp3.WebSocket;
import okhttp3.WebSocketListener;
import okio.ByteString;

package com.demo.amazing.net;



/**
 * Created by hzsunyj on 2017/8/28.
 */

public class WSListener extends WebSocketListener {

    WSCallBack callBack;

    public WSListener(WSCallBack callBack) {
        this.callBack = callBack;
    }

    @Override
    public void onOpen(WebSocket webSocket, Response response) {
        callBack.isConnected();
        LogUtil.e("client onOpen");
    }

    @Override
    public void onMessage(WebSocket webSocket, String text) {