--- CLOSE SOCKET BY NODE ID ---
483219
public void close(String nodeID) {
		SendBuffer buffer;
		synchronized (buffers) {
			buffer = buffers.remove(nodeID);
		}
		if (buffer != null) {
			buffer.close();
		}
	}
1240898
function kill(req, res) {
  // TODO: implement filters
  var conn;
  // single ip:port
  if(req.args.length === 1) {
    conn = req.args[0];

    // shouldn't get here, however there is a possible
    // race condition whereby the target connection quits
    // between validate and execute
    if(!conn) return res.send(null, null);

    // suicide
    if(conn.id === req.conn.id) {
      conn.write(Constants.OK, function onWrite() {
        conn.close();
      })
    // killing another connection
    }else{
      //console.dir('closing another connection...');
      conn.close(function onClose() {
        res.send(null, Constants.OK);
      })
    }
  }
}
192151
def _socket_close(self):
        """"""
        callback = self.__callback
        self.__callback = None
        try:
            if callback:
                callback(None, InterfaceError('connection closed'))
        finally:
            # Flush the job queue, don't call the callbacks associated with the remaining jobs
            # since they have already been called as error callback on connection closing
            self.__job_queue = []
            self.__alive = False
            self.__pool.cache(self)
1344213
def close_socket(self):
        ''''''
        log.debug("Closing socket")
        if self.sock:
            try:
                self.sock.close()
            except:
                pass

            self.sock = None
168891
def pub_close(self):
        '''
        
        '''
        if hasattr(self._sock_data, 'sock'):
            self._sock_data.sock.close()
            delattr(self._sock_data, 'sock')
1196671
@Override
  public void close() {

    LOG.log(Level.FINE, "Closing netty transport socket address: {0}", this.localAddress);

    final ChannelGroupFuture clientChannelGroupFuture = this.clientChannelGroup.close();
    final ChannelGroupFuture serverChannelGroupFuture = this.serverChannelGroup.close();
    final ChannelFuture acceptorFuture = this.acceptor.close();

    final ArrayList<Future> eventLoopGroupFutures = new ArrayList<>(3);
    eventLoopGroupFutures.add(this.clientWorkerGroup.shutdownGracefully());
    eventLoopGroupFutures.add(this.serverBossGroup.shutdownGracefully());
    eventLoopGroupFutures.add(this.serverWorkerGroup.shutdownGracefully());

    clientChannelGroupFuture.awaitUninterruptibly();
    serverChannelGroupFuture.awaitUninterruptibly();

    try {
      acceptorFuture.sync();
    } catch (final Exception ex) {
      LOG.log(Level.SEVERE, "Error closing the acceptor channel for " + this.localAddress, ex);
    }

    for (final Future eventLoopGroupFuture : eventLoopGroupFutures) {
      eventLoopGroupFuture.awaitUninterruptibly();
    }

    LOG.log(Level.FINE, "Closing netty transport socket address: {0} done", this.localAddress);
  }
797827
@Override
    public void close() throws IOException {
        dispose();

        if(socket != null) {
            socket.close();
            socket = null;
        }
    }
1169940
@Override
    public void close() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "close");
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "SocketChannel close starting, local: " + socket.getLocalSocketAddress() + " remote: " + socket.getRemoteSocketAddress());
        }
        // synchronize on this SocketIOChannel to prevent duplicate closes from
        // being processed
        synchronized (this) {
            if (closed) {
                processClose = false;
            }
            closed = true;
        }
        if (processClose) {
            try {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    Tr.event(tc, "AsyncSocketChannel close, local: " + socket.getLocalSocketAddress() + " remote: " + socket.getRemoteSocketAddress());
                if (asyncChannel != null) {
                    asyncChannel.close();
                }
            } catch (IOException ioe) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "IOException while closing channel " + ioe.getMessage());
                }
            } finally {
                super.close();
            }
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "close called on channel already closed, local: " + socket.getLocalSocketAddress() + " remote: " + socket.getRemoteSocketAddress());
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "close");
        }
    }
686332
static void removeClosedChannel(String nodeId) {
        if (lock.tryLock()) {
            try {
                nodeId_to_connectedChannel_map.remove(nodeId);
                LOG.info(String.format("RpcClient:与%s的空闲长连接缓存释放完毕...", nodeId));
            } finally {
                lock.unlock();
            }
        } else {
            LOG.info(String.format("RpcClient删除缓存的与%s的废弃的连接：已经有新连接正在建立，那么这里不做操作，由新建连接的线程去覆盖掉缓存中的废弃连接", nodeId));
        }
    }
664855
protected synchronized void disconnect()
    {
        if (socket != null)
        {
            logger.info("Closing socket.");
            try
            {
                socket.close();
            }
            catch (IOException ex)
            {
                logger.warn("Unable to close socket: " + ex.getMessage());
            }
            socket = null;
        }
        protocolIdentifier.reset();
    }
471414
@Override
	public void close()
	{
		LOG.debug("Going to close tcp connection in class: {}", this
				.getClass().getName());
		Event event = Events.event(null, Events.DISCONNECT);
		if (channel.isConnected())
		{
			channel.write(event).addListener(ChannelFutureListener.CLOSE);
		}
		else
		{
			channel.close();
			LOG.trace("Unable to write the Event {} with type {} to socket",
					event, event.getType());
		}
	}
1158516
function disconnect(socket) {
  if (socket.namespace.name === '') return socket.disconnect();
  socket.packet({type:'disconnect'});
  socket.manager.onLeave(socket, socket.namespace.name);
  socket.$emit('disconnect', 'booted');
}
465171
def delete_node(self, node_id):
        

        node = None
        try:
            node = self.get_node(node_id)
            yield from self.close_node(node_id)
        finally:
            if node:
                node.project.emit("node.deleted", node)
                yield from node.project.remove_node(node)
        if node.id in self._nodes:
            del self._nodes[node.id]
        return node
199
def end(self, close_fileobj=True):
        """"""
        log.debug("in TftpContext.end - closing socket")
        self.sock.close()
        if close_fileobj and self.fileobj is not None and not self.fileobj.closed:
            log.debug("self.fileobj is open - closing")
            self.fileobj.close()
280821
private synchronized void closeAllAcceptedSockets() {
    for (int x = 0; x < socketList.size(); x++) {
      try {
        ((Socket) socketList.get(x)).close();
      } catch (Exception e) {
        // ignore for now
      }
    }

    // clear member variables
    socketMap.clear();
    socketList.clear();
  }
1075804
def stop(self):
        """"""
        self.logger.warning("Stop executed")
        try:
            self._socket.close()
        except Exception:
            self.logger.error("Error while closing socket")
            raise VelbusException("Error while closing socket")
        time.sleep(1)
1366511
public void close() {
		stopped = true;
		try {
			if (logger.isDebugEnabled()) {
				logger.debug("Closing socket");
			}
			// selector.close();
			socket.close();

			if (this.channel != null) {
				this.channel.close();
			}

			for(int i=0;i<decodingThreads.length;i++) {
				decodingThreads[i].shutdown();
			}
			
		} catch (Exception e) {
			if(logger.isErrorEnabled())
			{
				logger.error("Could not gracefully close socket", e);
			}
		}
	}