void finish() { // Stop the ping sender and the pong sender. mPingSender.stop(); mPongSender.stop(); try { // Close the raw socket. mSocketConnector.getSocket().close(); } catch (Throwable t) { // Ignore any error raised by close(). } synchronized (mStateManager) { // Change the state to CLOSED. mStateManager.setState(CLOSED); } // Notify the listeners of the state change. mListenerManager.callOnStateChanged(CLOSED); // Notify the listeners that the WebSocket was disconnected. mListenerManager.callOnDisconnected( mServerCloseFrame, mClientCloseFrame, mStateManager.getClosedByServer()); }
void finish() { // Stop the ping sender and the pong sender. mPingSender.stop(); mPongSender.stop(); try { // Close the raw socket. mSocketConnector.getSocket().close(); } catch (Throwable t) { // Ignore any error raised by close(). } synchronized (mStateManager) { // Change the state to CLOSED. mStateManager.setState(CLOSED); } // Notify the listeners of the state change. mListenerManager.callOnStateChanged(CLOSED); // Notify the listeners that the WebSocket was disconnected. mListenerManager.callOnDisconnected( mServerCloseFrame, mClientCloseFrame, mStateManager.getClosedByServer()); }