function _close_channel($client_channel, $want_reply = false)
    {
        // see http://tools.ietf.org/html/rfc4254#section-5.3

        $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_EOF, $this->server_channels[$client_channel]));

        if (!$want_reply) {
            $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$client_channel]));
        }

        $this->channel_status[$client_channel] = NET_SSH2_MSG_CHANNEL_CLOSE;

        $this->curTimeout = 0;

        while (!is_bool($this->_get_channel_packet($client_channel))) {
        }

        if ($want_reply) {
            $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$client_channel]));
        }

        if ($this->bitmap & self::MASK_SHELL) {
            $this->bitmap&= ~self::MASK_SHELL;
        }
    }
function _close_channel($client_channel, $want_reply = false)
    {
        // see http://tools.ietf.org/html/rfc4254#section-5.3

        $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_EOF, $this->server_channels[$client_channel]));

        if (!$want_reply) {
            $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$client_channel]));
        }

        $this->channel_status[$client_channel] = NET_SSH2_MSG_CHANNEL_CLOSE;

        $this->curTimeout = 0;

        while (!is_bool($this->_get_channel_packet($client_channel))) {
        }

        if ($want_reply) {
            $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$client_channel]));
        }

        if ($this->bitmap & self::MASK_SHELL) {
            $this->bitmap&= ~self::MASK_SHELL;
        }
    }
function _close_channel ( $ client_channel , $ want_reply = false ) { // see http://tools.ietf.org/html/rfc4254#section-5.3 $ this -> _send_binary_packet ( pack ( 'CN' , NET_SSH2_MSG_CHANNEL_EOF , $ this -> server_channels [ $ client_channel ] ) ) ; if ( ! $ want_reply ) { $ this -> _send_binary_packet ( pack ( 'CN' , NET_SSH2_MSG_CHANNEL_CLOSE , $ this -> server_channels [ $ client_channel ] ) ) ; } $ this -> channel_status [ $ client_channel ] = NET_SSH2_MSG_CHANNEL_CLOSE ; $ this -> curTimeout = 0 ; while ( ! is_bool ( $ this -> _get_channel_packet ( $ client_channel ) ) ) { } if ( $ want_reply ) { $ this -> _send_binary_packet ( pack ( 'CN' , NET_SSH2_MSG_CHANNEL_CLOSE , $ this -> server_channels [ $ client_channel ] ) ) ; } if ( $ this -> bitmap & self :: MASK_SHELL ) { $ this -> bitmap &= ~ self :: MASK_SHELL ; } }
Closes and flushes a channel

\phpseclib\Net\SSH2 doesn't properly close most channels.  For exec() channels are normally closed by the server
and for SFTP channels are presumably closed when the client disconnects.  This functions is intended
for SCP more than anything.

@param int $client_channel
@param bool $want_reply
@return bool
@access private
Closes and flushes a channel