public override void Flush() { if (closed) { throw new IOException("Already closed"); } if (dataLen == 0) { return; } packet.reset(); buffer.putByte((byte)Session.SSH_MSG_CHANNEL_DATA); buffer.putInt(channel.recipient); buffer.putInt(dataLen); buffer.skip(dataLen); try { int foo = dataLen; dataLen = 0; channel.getSession().write(packet, channel, foo); } catch (Exception e) { Close(); throw new IOException(e.Message, e); } }