@Override public void failed(Throwable exc, Void attachment) { if (exc instanceof InterruptedByTimeoutException) { exc = new SocketTimeoutException(); } if (block) { SendResult sr = new SendResult(exc); handler.onResult(sr); } else { wsWriteTimeout.unregister(WsRemoteEndpointImplServer.this); clearHandler(exc, true); close(); } } }, buffers);
@Override public void failed(Throwable exc, Void attachment) { if (exc instanceof InterruptedByTimeoutException) { exc = new SocketTimeoutException(); } if (block) { SendResult sr = new SendResult(exc); handler.onResult(sr); } else { wsWriteTimeout.unregister(WsRemoteEndpointImplServer.this); clearHandler(exc, true); close(); } } }, buffers);
@Override public void completed(Long result, Void attachment) { if (block) { long timeout = blockingWriteTimeoutExpiry - System.currentTimeMillis(); if (timeout <= 0) { failed(new SocketTimeoutException(), null); } else { handler.onResult(SENDRESULT_OK); } } else { wsWriteTimeout.unregister(WsRemoteEndpointImplServer.this); clearHandler(null, true); if (close) { close(); } } } @Override
@Override public void completed(Long result, Void attachment) { if (block) { long timeout = blockingWriteTimeoutExpiry - System.currentTimeMillis(); if (timeout <= 0) { failed(new SocketTimeoutException(), null); } else { handler.onResult(SENDRESULT_OK); } } else { wsWriteTimeout.unregister(WsRemoteEndpointImplServer.this); clearHandler(null, true); if (close) { close(); } } } @Override
@Override protected void doClose() { if (handler != null) { // close() can be triggered by a wide range of scenarios. It is far // simpler just to always use a dispatch than it is to try and track // whether or not this method was called by the same thread that // triggered the write clearHandler(new EOFException(), true); } try { sos.close(); } catch (IOException e) { WebsocketsLogger.ROOT_LOGGER.closeFailed(e); } wsWriteTimeout.unregister(this); }
@Override protected void doClose() { if (handler != null) { // close() can be triggered by a wide range of scenarios. It is far // simpler just to always use a dispatch than it is to try and track // whether or not this method was called by the same thread that // triggered the write clearHandler(new EOFException(), true); } try { sos.close(); } catch (IOException e) { if (log.isInfoEnabled()) { log.info(sm.getString("wsRemoteEndpointServer.closeFailed"), e); } } wsWriteTimeout.unregister(this); }
wsWriteTimeout.unregister(this); clearHandler(null, useDispatch); if (close) { wsWriteTimeout.unregister(this); clearHandler(ioe, useDispatch); close();
wsWriteTimeout.unregister(this); clearHandler(null, useDispatch); if (close) { wsWriteTimeout.unregister(this); clearHandler(ioe, useDispatch); close();
@Override protected void doClose() { if (handler != null) { // close() can be triggered by a wide range of scenarios. It is far // simpler just to always use a dispatch than it is to try and track // whether or not this method was called by the same thread that // triggered the write clearHandler(new EOFException(), true); } try { socketWrapper.close(); } catch (IOException e) { if (log.isInfoEnabled()) { log.info(sm.getString("wsRemoteEndpointServer.closeFailed"), e); } } wsWriteTimeout.unregister(this); }
@Override protected void doClose() { if (handler != null) { // close() can be triggered by a wide range of scenarios. It is far // simpler just to always use a dispatch than it is to try and track // whether or not this method was called by the same thread that // triggered the write clearHandler(new EOFException(), true); } try { socketWrapper.close(); } catch (IOException e) { if (log.isInfoEnabled()) { log.info(sm.getString("wsRemoteEndpointServer.closeFailed"), e); } } wsWriteTimeout.unregister(this); }
@Override protected void doClose() { if (handler != null) { // close() can be triggered by a wide range of scenarios. It is far // simpler just to always use a dispatch than it is to try and track // whether or not this method was called by the same thread that // triggered the write clearHandler(new EOFException(), true); } try { sos.close(); } catch (IOException e) { if (log.isInfoEnabled()) { log.info(sm.getString("wsRemoteEndpointServer.closeFailed"), e); } } wsWriteTimeout.unregister(this); }
complete = sos.isReady(); if (complete) { wsWriteTimeout.unregister(this); clearHandler(null, useDispatch); if (close) { wsWriteTimeout.unregister(this); clearHandler(ioe, useDispatch); close();
complete = socketWrapper.isReadyForWrite(); if (complete) { wsWriteTimeout.unregister(this); clearHandler(null, useDispatch); if (close) { wsWriteTimeout.unregister(this); clearHandler(e, useDispatch); close();
complete = socketWrapper.isReadyForWrite(); if (complete) { wsWriteTimeout.unregister(this); clearHandler(null, useDispatch); if (close) { wsWriteTimeout.unregister(this); clearHandler(e, useDispatch); close();