/** * closes this channel */ public void Close() { if (_connection.IsClosed()) { return; } if (_type == ChannelType.Shell) { SSH1DataWriter wr2 = new SSH1DataWriter(); wr2.Write(_remoteID); SSH1Packet p2 = SSH1Packet.FromPlainPayload(PacketType.SSH_CMSG_EOF, wr2.ToByteArray()); Transmit(p2); } SSH1DataWriter wr = new SSH1DataWriter(); wr.Write(_remoteID); SSH1Packet p = SSH1Packet.FromPlainPayload(PacketType.SSH_MSG_CHANNEL_CLOSE, wr.ToByteArray()); Transmit(p); }