Tencent / VasSonic

VasSonic is a lightweight and high-performance Hybrid framework developed by tencent VAS team, which is intended to speed up the first screen of websites working on Android and iOS platform.
Other
11.8k stars 1.61k forks source link

3.1.0版本调用sonicSession.destroy()报server disconnect error #310

Closed 1079107009 closed 5 years ago

1079107009 commented 5 years ago

@Override protected void onDestroy() { super.onDestroy();

    if (sonicSession != null) {
        sonicSession.destroy();
        sonicSession = null;
    }
}

SonicServer

public void disconnect() {

    try {
        BufferedInputStream bufferedInputStream = connectionImpl.getResponseStream();
        if (bufferedInputStream != null) {
            bufferedInputStream.close();
        }
    } catch (Throwable e) {
        SonicUtils.log(TAG, Log.ERROR, "session(" + session.sId + ") server disconnect error:" + e.getMessage() + ".");
    }

    connectionImpl.disconnect();
}

报这个异常android.os.NetworkOnMainThreadException