Closes the channel. No data may be sent or receieved after this method
completes.
499137
public void close() {

		boolean performClose = false;
		;

		synchronized (this) {
			if (!closing && state == CHANNEL_OPEN) {
				performClose = closing = true;
			}
		}

		if (performClose) {

			synchronized (listeners) {
				for (Enumeration<ChannelEventListener> e = listeners.elements(); e
						.hasMoreElements();) {
					(e.nextElement()).channelClosing(this);
				}
			}

			try {
				// Close the ChannelOutputStream
				out.close(!isLocalEOF);

				// Send our close message
				ByteArrayWriter msg = new ByteArrayWriter(5);
				msg.write(SSH_MSG_CHANNEL_CLOSE);
				msg.writeInt(remoteid);

				try {
					if (Log.isDebugEnabled()) {
						Log.debug(this,
								"Sending SSH_MSG_CHANNEL_CLOSE id=" + channelid
										+ " rid=" + remoteid);
					}
					connection.sendMessage(msg.toByteArray(), true);
				} catch (SshException ex1) {
					if (Log.isDebugEnabled()) {
						Log.debug(this,
								"Exception attempting to send SSH_MSG_CHANNEL_CLOSE id="
										+ channelid + " rid=" + remoteid, ex1);
					}
				} finally {
					msg.close();
				}

				this.state = CHANNEL_CLOSED;

			} catch (EOFException eof) {
				// Ignore this is the message store informing of close/eof
			} catch (SshIOException ex) {
				if (Log.isDebugEnabled()) {
					Log.debug(this,
							"SSH Exception during close reason="
									+ ex.getRealException().getReason()
									+ " id=" + channelid + " rid=" + remoteid,
							ex.getRealException());
				}
				// IO Error during close so the connection has dropped
				connection.transport.disconnect(
						TransportProtocol.CONNECTION_LOST,
						"IOException during channel close: " + ex.getMessage());
			} catch (IOException ex) {
				if (Log.isDebugEnabled()) {
					Log.debug(this, "Exception during close id="
							+ channelid + " rid=" + remoteid, ex);
				}
				// IO Error during close so the connection has dropped
				connection.transport.disconnect(
						TransportProtocol.CONNECTION_LOST,
						"IOException during channel close: " + ex.getMessage());
			} finally {
				checkCloseStatus(ms.isClosed());
			}
		}
	}
1212252
public void destroy() {
        setState(STATE_STOPPED);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Destroying: " + this);
        }
        this.channelFactory.removeChannel(getName());
    }
887254
@Override
  public void close()
    throws IOException
  {
    SocketChannel s = _channel;
    _channel = null;
    
    SSLSocket sslSocket = _sslSocket;
    _sslSocket = null;

    if (sslSocket != null) {
      try {
        sslSocket.close();
      } catch (Exception e) {
      }
    }

    if (s != null) {
      try {
        s.close();
      } catch (Exception e) {
      }
    }
  }
605515
public function close()
    {
        foreach ($this->channel_refs as $channel_ref) {
            $channel_ref->getRealChannel($this->credentials)->close();
        }
        $this->is_closed = true;
    }
885439
public void close() {
        if (this.m_stream != null) {
            try {
                this.m_stream.close();
                this.m_stream = null;
            } catch (IOException e) {
                logger.warn("Error closing stream", e);
            }
        }
    }
641697
@Override
  public void close() {
    if (closed) return;
    
    closed = true;
    
    try {
      selector.close();
    } catch (Exception e) {
      logger.log("Failed to close multicast publisher selctor for: '" + name + "'", e);
    }
    
    try {
      publisherChannel.close();
    } catch (Exception e) {
      logger.log("Failed to close multicast publisher channel for: '" + name + "'", e);
    }
    
    try {
      readChannel.close();
    } catch (Exception e) {
      logger.log("Failed to close multicast reader channel for: '" + name + "'", e);
    }
  }
529557
public static void closeQuietly(final Channel channel)
    {
        if (channel != null && channel.isOpen()) {
            try {
                channel.close();
            }
            catch (IOException ioe) {
                LOG.warnDebug(ioe, "While closing session");
            }
        }
    }
81020
public synchronized void close() {
        if (!closed && channel != null) {
            ConnectionWatchdog watchdog = channel.getPipeline().get(ConnectionWatchdog.class);
            watchdog.setReconnect(false);
            closed = true;
            channel.close();
        }
    }
1270740
@Override
  public void close() throws IOException
  {
    SocketChannel channel = _channel;
    _channel = null;

    if (channel != null)
      channel.close();
  }
630710
protected void closeChannel ()
    {
        if (_channel != null) {
            log.debug("Closing socket channel.");

            try {
                _channel.close();
            } catch (IOException ioe) {
                log.warning("Error closing failed socket: " + ioe);
            }
            _channel = null;

            // clear these out because they are probably large and in charge
            _oin = null;
            _oout = null;
        }
    }
336746
def close(self):
        

        data = self.data
        self.data = None

        if hasattr(data, "close"):
            data.close()
775968
public ChannelFuture close(Channel channel, CloseWebSocketFrame frame) {
        if (channel == null) {
            throw new NullPointerException("channel");
        }
        return close(channel, frame, channel.newPromise());
    }
49923
@Override
    public void close() throws IOException {
        if (isClosed) {
            return;
        }
        flush(sendEor);
        if (sendClose) {
            eventPipeline.fire(new Close(), channel);
        }
        isClosed = true;
    }
179227
private function close()
    {
        if (null !== $this->pipe && $this->pipe->isOpen()) {
            $this->pipe->close();
        }

        if (is_resource($this->socket)) {
            fclose($this->socket);
        }

        $this->thread = null;
        $this->channel = null;
    }
998917
public void close() {
        //log.debug("Stream close: {}", publishedName);
        if (closed.compareAndSet(false, true)) {
            if (livePipe != null) {
                livePipe.unsubscribe((IProvider) this);
            }
            // if we have a recording listener, inform that this stream is done
            if (recordingListener != null) {
                sendRecordStopNotify();
                notifyRecordingStop();
                // inform the listener to finish and close
                recordingListener.get().stop();
            }
            sendPublishStopNotify();
            // TODO: can we send the client something to make sure he stops sending data?
            if (connMsgOut != null) {
                connMsgOut.unsubscribe(this);
            }
            notifyBroadcastClose();
            // clear the listener after all the notifications have been sent
            if (recordingListener != null) {
                recordingListener.clear();
            }
            // clear listeners
            if (!listeners.isEmpty()) {
                listeners.clear();
            }
            // deregister with jmx
            unregisterJMX();
            setState(StreamState.CLOSED);
        }
    }
136742
protected void close() {
        _state = State.DISCONNECTED;

        shutdown();

        // remove the connection from map
        NetMgr.getInstance().dropConnection(InetSocketAddress.createUnresolved(_remoteHost, _port));

        // notify all the pending requests in the timeout map
        notifyAllPendingSenders("Channel closed, connection closing.");
    }
605281
public void close() {
        done = true;
        connected = false;
        synchronized (this) {
            try {
                if (socket != null) {
                    if (traceLevel >= ctrlThreshold) {
                        System.out.println("-> CLOSE");
                    }
                    socket.close();
                }
            } catch (final IOException e) { /* ignore socket close errors */
            } finally {
                socket = null;
            }
        }
    }