/** * Call {@link WebSocketListener#onError(WebSocket, WebSocketException) * onError} method of the listeners. */ private void callOnError(WebSocketException cause) { mWebSocket.getListenerManager().callOnError(cause); }
private void handleError(WebSocketException cause) { ListenerManager manager = mWebSocket.getListenerManager(); manager.callOnError(cause); manager.callOnConnectError(cause); } }
@Override public void runMain() { try { main(); } catch (Throwable t) { // An uncaught throwable was detected in the writing thread. WebSocketException cause = new WebSocketException( WebSocketError.UNEXPECTED_ERROR_IN_WRITING_THREAD, "An uncaught throwable was detected in the writing thread: " + t.getMessage(), t); // Notify the listeners. ListenerManager manager = mWebSocket.getListenerManager(); manager.callOnError(cause); manager.callOnUnexpectedError(cause); } synchronized (this) { // Mainly for queueFrame(). mStopped = true; notifyAll(); } // Notify this writing thread finished. notifyFinished(); }
private void doFlush() throws WebSocketException { try { // Flush flush(); synchronized (this) { mFlushNeeded = false; } } catch (IOException e) { // Flushing frames to the server failed. WebSocketException cause = new WebSocketException( WebSocketError.FLUSH_ERROR, "Flushing frames to the server failed: " + e.getMessage(), e); // Notify the listeners. ListenerManager manager = mWebSocket.getListenerManager(); manager.callOnError(cause); manager.callOnSendError(cause, null); throw cause; } }
@Override public void runMain() { try { main(); } catch (Throwable t) { // An uncaught throwable was detected in the reading thread. WebSocketException cause = new WebSocketException( WebSocketError.UNEXPECTED_ERROR_IN_READING_THREAD, "An uncaught throwable was detected in the reading thread: " + t.getMessage(), t); // Notify the listeners. ListenerManager manager = mWebSocket.getListenerManager(); manager.callOnError(cause); manager.callOnUnexpectedError(cause); } // Notify this reading thread finished. notifyFinished(); }
manager.callOnError(cause); manager.callOnSendError(cause, frame);
/** * Call {@link WebSocketListener#onError(WebSocket, WebSocketException) * onError} method of the listeners. */ private void callOnError(WebSocketException cause) { mWebSocket.getListenerManager().callOnError(cause); }
private void handleError(WebSocketException cause) { ListenerManager manager = mWebSocket.getListenerManager(); manager.callOnError(cause); manager.callOnConnectError(cause); } }
private void doFlush() throws WebSocketException { try { // Flush flush(); synchronized (this) { mFlushNeeded = false; } } catch (IOException e) { // Flushing frames to the server failed. WebSocketException cause = new WebSocketException( WebSocketError.FLUSH_ERROR, "Flushing frames to the server failed: " + e.getMessage(), e); // Notify the listeners. ListenerManager manager = mWebSocket.getListenerManager(); manager.callOnError(cause); manager.callOnSendError(cause, null); throw cause; } }
@Override public void runMain() { try { main(); } catch (Throwable t) { // An uncaught throwable was detected in the writing thread. WebSocketException cause = new WebSocketException( WebSocketError.UNEXPECTED_ERROR_IN_WRITING_THREAD, "An uncaught throwable was detected in the writing thread: " + t.getMessage(), t); // Notify the listeners. ListenerManager manager = mWebSocket.getListenerManager(); manager.callOnError(cause); manager.callOnUnexpectedError(cause); } synchronized (this) { // Mainly for queueFrame(). mStopped = true; notifyAll(); } // Notify this writing thread finished. notifyFinished(); }
@Override public void runMain() { try { main(); } catch (Throwable t) { // An uncaught throwable was detected in the reading thread. WebSocketException cause = new WebSocketException( WebSocketError.UNEXPECTED_ERROR_IN_READING_THREAD, "An uncaught throwable was detected in the reading thread: " + t.getMessage(), t); // Notify the listeners. ListenerManager manager = mWebSocket.getListenerManager(); manager.callOnError(cause); manager.callOnUnexpectedError(cause); } // Notify this reading thread finished. notifyFinished(); }
manager.callOnError(cause); manager.callOnSendError(cause, frame);