--- CLOSE CHANNEL ---
164170
protected void close(SelectionKey key, Exception cause) {
		if (key == null) {
			return;
		}

		// Cancel key
		key.cancel();

		// Get channel
		SelectableChannel channel = key.channel();
		if (channel == null) {
			return;
		}

		// Debug
		if (debug) {
			try {
				if (channel instanceof SocketChannel) {
					SocketChannel socketChannel = (SocketChannel) channel;
					logger.info("Client channel closed to " + socketChannel.getRemoteAddress() + ".", cause);
				}
			} catch (Exception ignored) {
			}
		}

		// Close channel
		try {
			channel.close();
		} catch (Exception ignored) {
		}
	}
116713
def close(self) -> None:
        
        self.__data_channel_buffer.stop()
        self.__data_channel_buffer.close()
        self.__data_channel_buffer = None
        if not self.__was_playing:
            self.__hardware_source.stop_playing()
205384
private void closeAll(){
        Feeder feeder = this;
        while(feeder.parent!=null)
            feeder = feeder.parent;
        while(feeder!=null){
            try{
                if(feeder.channel!=null)
                    feeder.channel.close();
            }catch(IOException ignore){
                // ignore
            }
            feeder = feeder.child;
        }
    }
59567
function onClose() {
    DEBUG("channel.onClose()")
    channel.eachAgent(function(agent){
      agent.shutDown()
    })

    channel.session.delChannel(this)
  }
1129833
public final void close() {
        while (subChannel.size() > 0) {
            subs.addSample(subChannel.poll());
        }
        while (pubChannel.size() > 0) {
            pubs.addSample(pubChannel.poll());
        }

        if (subs.hasSamples()) {
            start = subs.getStart();
            end = subs.getEnd();

            if (pubs.hasSamples()) {
                end = Math.min(end, pubs.getEnd());
            }
        } else {
            start = pubs.getStart();
            end = pubs.getEnd();
        }

        msgBytes = pubs.msgBytes + subs.msgBytes;
        ioBytes = pubs.ioBytes + subs.ioBytes;
        msgCnt = pubs.msgCnt + subs.msgCnt;
        jobMsgCnt = pubs.jobMsgCnt + subs.jobMsgCnt;
    }
1176640
@Override
    public ChannelFuture close(Channel channel, CloseWebSocketFrame frame, ChannelPromise promise) {
        return channel.writeAndFlush(frame, promise);
    }
1184606
@Handler
    @SuppressWarnings("PMD.DataflowAnomalyAnalysis")
    public void onClose(Close event) throws IOException, InterruptedException {
        for (Channel channel : event.channels()) {
            if (channel instanceof TcpChannelImpl
                && channels.contains(channel)) {
                ((TcpChannelImpl) channel).close();
            }
        }
    }
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);
			}
		}
	}
1102580
private void potentiallyCloseLeakingChannel(final SocketChannel ch,
    final MemcachedNode node) {
    if (ch != null && !ch.isConnected() && !ch.isConnectionPending()) {
      try {
        ch.close();
      } catch (IOException e) {
        getLogger().error("Exception closing channel: %s", node, e);
      }
    }
  }
416437
@Override
    public void close() throws IOException
    {
        if (!isClosed)
        {
            flush();
            if (closeChannel)
            {
                channel.close();
            }
            isClosed = true;
        }
    }
1082504
public function close()
    {
        $outputFrame = ProtocolChannel\ChannelCloseFrame::create(
            0,//@todo replyCode
            'Channel closed by client'
        );
        $outputFrame->frameChannelId = $this->id;
        $this->connection->command($outputFrame);
    }
165356
def _do_close(self):
        
        AMQP_LOGGER.debug('Closed channel #%d' % self.channel_id)
        self.is_open = False
        del self.connection.channels[self.channel_id]
        self.channel_id = self.connection = None
        self.callbacks = {}
323574
protected void closeIdleChannels ()
    {
        long now = System.currentTimeMillis();
        Iterator<Map.Entry<ChatChannel, ChannelInfo>> iter = _channels.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry<ChatChannel, ChannelInfo> entry = iter.next();
            if (now - entry.getValue().lastMessage > IDLE_CHANNEL_CLOSE_TIME) {
                ((CrowdNodeObject)_peerMan.getNodeObject()).removeFromHostedChannels(
                    entry.getKey());
                iter.remove();
            }
        }
    }
198998
def close_socket(self):
        """"""
        if _debug: UDPDirector._debug("close_socket")

        self.socket.close()
        self.close()
        self.socket = None
318781
public static void closeChannels(AbstractInterruptibleChannel... channels) {
		for (AbstractInterruptibleChannel channel : channels) {
			if (channel == null)
				continue;
			try {
				channel.close();
			} catch (Exception e) {
				log.error(FAILED_TO_CLOSE_CHANNEL, e);
			}
		}
	}
402110
@Override
  public void closeImpl() throws IOException
  {
    unlock();

    _fileChannel = null;

    RandomAccessFile file = _file;
    _file = null;

    if (file != null)
      file.close();
  }
503727
def channels_close(self, room_id, **kwargs):
        """"""
        return self.__call_api_post('channels.close', roomId=room_id, kwargs=kwargs)