TakahikoKawasaki / nv-websocket-client

High-quality WebSocket client implementation in Java.
Apache License 2.0
2.03k stars 292 forks source link

Ho to detect Half Open Socket? #172

Open autooz opened 6 years ago

autooz commented 6 years ago

Hi! Where is the best place of the code where I can try to catch the half open socket info? I planing to send a signal to Listner/WebSocketAdapter like this

                @Override
                public void onHalfOpenSocket(WebSocket websocket,state) throws Exception {
                    Log.d(pseudo_tag, "HalfOpenSocket()");
                    String message = recepient + MutGlobalData.CHANNEL_SEPARATOR + MutGlobalData.CONNECTION_STATE + MutGlobalData.TOKEN_SEPARATOR +  MutGlobalData.INTERNET_OFFLINE;
                    EventBus.getDefault().post(new EventToWorkingThreadMessage(message), MutGlobalData.FOR_INITIATOR_CONNECT);
                }