Refine search
public void close() { Socket socket = this.socket; if (socket != null) { try { socket.shutdownInput(); } catch (IOException e) { // Ignore, could not do anymore } try { socket.shutdownOutput(); } catch (IOException e) { // Ignore, could not do anymore } try { socket.close(); } catch (IOException e) { // Ignore, could not do anymore } } this.input = null; this.output = null; this.socket = null; }
public void gracefulDisconnect(Socket sok) { InputStream is = sok.getInputStream(); sok.shutdownOutput(); // Sends the 'FIN' on the network while (is.read() >= 0) ; // "read()" returns '-1' when the 'FIN' is reached sok.close(); // Now we can close the Socket }
@Override protected void finalize() throws Throwable { try { if ( socket != null ) { socket.shutdownInput(); socket.shutdownOutput(); socket.close(); } } catch ( java.io.IOException e ) { // Ignore errors } finally { super.finalize(); } }
@Override public void close() throws IOException { try { socket.shutdownInput(); // for socketInputStream.setEOF(true) } catch (Exception e) { // ignore } try { socket.shutdownOutput(); } catch (Exception e) { // ignore } socket.close(); } }
@Override protected void finalize() throws Throwable { try { if ( socket != null ) { socket.shutdownInput(); socket.shutdownOutput(); socket.close(); } if ( serverSocket != null ) { serverSocket.close(); } } catch ( IOException e ) { // Ignore errors } finally { super.finalize(); } }
@Override protected void finalize() throws Throwable { try { if ( clientSocket != null ) { clientSocket.shutdownInput(); clientSocket.shutdownOutput(); clientSocket.close(); } if ( serverSocket != null ) { serverSocket.close(); } } catch ( java.io.IOException e ) { // Ignore errors } finally { super.finalize(); } }
o.write("Remoting-Minimum-Version: " + RemotingVersionInfo.getMinimumSupportedVersion() + "\r\n"); o.flush(); s.shutdownOutput(); } else { o.write("HTTP/1.0 404 Not Found\r\n"); o.write("Not Found\r\n"); o.flush(); s.shutdownOutput(); s.shutdownInput(); } finally { s.close();
public void close() throws IOException { if (!this.open) { return; } this.open = false; doFlush(); try { this.socket.shutdownOutput(); } catch (IOException ignore) { } try { this.socket.shutdownInput(); } catch (IOException ignore) { } this.socket.close(); }
public void close() throws IOException { if (!this.open) { return; } this.open = false; doFlush(); try { try { this.socket.shutdownOutput(); } catch (IOException ignore) { } try { this.socket.shutdownInput(); } catch (IOException ignore) { } } catch (UnsupportedOperationException ignore) { // if one isn't supported, the other one isn't either } this.socket.close(); }
sock.socket().shutdownOutput(); } catch (IOException e) { if (LOG.isDebugEnabled()) { sock.socket().close(); } catch (IOException e) { if (LOG.isDebugEnabled()) {
sock.socket().shutdownOutput(); } catch (IOException e) { sock.socket().close(); } catch (IOException e) { if (LOG.isDebugEnabled()) {
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { // Ignore errors, we don't care // If we are here, it means all work is done // It's a lot of work to keep it all in sync for now we don't need to do that. // try { data.inputStream.close(); } catch ( Exception e ) { // Ignore nested exception } try { data.outputStream.close(); } catch ( Exception e ) { // Ignore nested exception } try { data.socket.shutdownInput(); data.socket.shutdownOutput(); data.socket.close(); } catch ( Exception e ) { // Ignore nested exception } super.dispose( smi, sdi ); }
@Override public synchronized void close() { disposeSasl(); data = null; callCleanup = null; if (!channel.isOpen()) return; try { socket.shutdownOutput(); } catch (Exception ignored) { if (SimpleRpcServer.LOG.isTraceEnabled()) { SimpleRpcServer.LOG.trace("Ignored exception", ignored); } } if (channel.isOpen()) { try { channel.close(); } catch (Exception ignored) { } } try { socket.close(); } catch (Exception ignored) { if (SimpleRpcServer.LOG.isTraceEnabled()) { SimpleRpcServer.LOG.trace("Ignored exception", ignored); } } }
sock.getOutputStream().write("isro".getBytes()); sock.getOutputStream().flush(); sock.shutdownOutput(); br = new BufferedReader( new InputStreamReader(sock.getInputStream())); if (sock != null) { try { sock.close(); } catch (IOException e) { LOG.warn("Unexpected exception", e);
sock.shutdownOutput(); throw new IOException("Exception while executing four letter word: " + cmd, e); } finally { sock.close(); if (reader != null) { reader.close();
outstream.flush(); sock.shutdownOutput(); throw new IOException("Exception while executing four letter word: " + cmd, e); } finally { sock.close(); if (reader != null) { reader.close();
sock.socket().shutdownOutput(); } catch (IOException e) { if (LOG.isDebugEnabled()) { sock.socket().close(); } catch (IOException e) { if (LOG.isDebugEnabled()) {
public static void closeQuietly(final Socket socket) { if (socket == null) { return; } try { try { // can't shudown input/output individually with secure sockets if ((socket instanceof SSLSocket) == false) { if (socket.isInputShutdown() == false) { socket.shutdownInput(); } if (socket.isOutputShutdown() == false) { socket.shutdownOutput(); } } } finally { if (socket.isClosed() == false) { socket.close(); } } } catch (final Exception ex) { logger.debug("Failed to close socket due to: " + ex, ex); } }
sock.socket().shutdownOutput(); } catch (IOException e) { sock.socket().close(); } catch (IOException e) { if (LOG.isDebugEnabled()) {
sock.getOutputStream().write("isro".getBytes()); sock.getOutputStream().flush(); sock.shutdownOutput(); br = new BufferedReader( new InputStreamReader(sock.getInputStream())); if (sock != null) { try { sock.close(); } catch (IOException e) { LOG.warn("Unexpected exception", e);