public void close() throws IOException { serverChannel.close(); }
private void tryClose(ServerSocketChannel s) { try { s.close(); } catch (IOException sse) { LOG.error("Error while closing server socket.", sse); } }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
public static void closeAll() { try { H2O._udpSocket.close(); } catch( IOException e ) { } try { H2O._apiSocket.close(); } catch( IOException e ) { } try { TCPReceiverThread.SOCK.close(); } catch( IOException e ) { } }
public void close() { try { this.server.close(); LOG.info("Closed tunnel."); } catch (IOException ioe) { LOG.warn("Exception during shutdown of tunnel", ioe); } finally { try { this.thread.interrupt(); this.thread.join(); } catch (InterruptedException e) { throw new RuntimeException(e); } } }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override public void close() { closed = true; chronicle.close(); try { server.close(); } catch (IOException e) { logger.warning("Error closing server port " + e); } }
/** * {@inheritDoc} */ @Override public void shutdown(final boolean interrupt) { super.shutdown(interrupt); try { this.serverSocketChannel.close(); this.selector.close(); } catch (IOException e) { log.error("AcceptSocketService shutdown exception", e); } }
/** * Initiates the shuts down of the listener. */ public void shutdown() { shuttingDown = true; try { SocketAddress localAddress = serverSocket.getLocalAddress(); if (localAddress instanceof InetSocketAddress) { InetSocketAddress address = (InetSocketAddress) localAddress; Socket client = new Socket(address.getHostName(), address.getPort()); client.setSoTimeout(1000); // waking the acceptor loop should be quick new PingAgentProtocol().connect(client); } } catch (IOException e) { LOGGER.log(Level.FINE, "Failed to send Ping to wake acceptor loop", e); } try { serverSocket.close(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to close down TCP port",e); } }
public void close() throws IOException, InterruptedException { // Set the thread to stop go.set(false); // Make sure the channel is closed serverChannel.close(); // Force the selector to stop blocking wakeupSelector(); // And wait for it join(); }
public void close() throws IOException { try { channel.close(); } finally { handle.cancelKey(true); safeClose(mbeanHandle); } }
public void close() throws IOException { try { channel.close(); } finally { for (NioTcpServerHandle handle : handles) { handle.cancelKey(false); } safeClose(mbeanHandle); } }
/** * Clean up everything after a shutdown */ private void doServerShutdown() { stopConnectionLostTimer(); if( decoders != null ) { for( WebSocketWorker w : decoders ) { w.interrupt(); } } if( selector != null ) { try { selector.close(); } catch ( IOException e ) { log.error( "IOException during selector.close", e ); onError( null, e ); } } if( server != null ) { try { server.close(); } catch ( IOException e ) { log.error( "IOException during server.close", e ); onError( null, e ); } } }
/** {@inheritDoc} */ @Override public void kill() { try { if (quorumPeer != null) { Field cnxnFactoryField = QuorumPeer.class.getDeclaredField("cnxnFactory"); cnxnFactoryField.setAccessible(true); ServerCnxnFactory cnxnFactory = (ServerCnxnFactory)cnxnFactoryField.get(quorumPeer); cnxnFactory.closeAll(); Field ssField = cnxnFactory.getClass().getDeclaredField("ss"); ssField.setAccessible(true); ServerSocketChannel ss = (ServerSocketChannel)ssField.get(cnxnFactory); ss.close(); } close(); } catch (Exception e) { e.printStackTrace(); } }
@Override public void applyx(IgniteInternalFuture<?> future) throws IgniteCheckedException { try { if (log != null && log.isInfoEnabled()) log.info("Server socket closed " + ch.getLocalAddress()); ch.close(); } catch (Exception ex) { U.error(log, "Fail close socket.", ex); throw new IgniteCheckedException(ex); } } });
@Override public synchronized void stop() { if (isStopped()) return; logger.info("Stopping nio net server"); super.stop(); nioEventLoopAdapter.close(); if (serverChannel != null) { try { serverChannel.close(); serverChannel = null; } catch (Throwable e) { } } }
public void stop() { stopped = true; // Stop queuing connection attempts try { ss.close(); } catch (IOException e) { LOG.warn("Error closing listen socket", e); } if (acceptThread != null) { if (acceptThread.isAlive()) { acceptThread.wakeupSelector(); } else { acceptThread.closeSelector(); } } if (expirerThread != null) { expirerThread.interrupt(); } for (SelectorThread thread : selectorThreads) { if (thread.isAlive()) { thread.wakeupSelector(); } else { thread.closeSelector(); } } if (workerPool != null) { workerPool.stop(); } }
public void close() throws IOException, InterruptedException { this.serverSocketChannel.close(); closeSocketChannels(); acceptorThread.interrupt(); acceptorThread.join(); interrupt(); join(); }