This project is read-only.

Eof message

Nov 23, 2014 at 2:48 PM

i try to update the library to the new release.
I saw in the new version the eof is only send in the close method of the channel class. Before i was able to send it without closing the channel with a small modification to the source code.

Being able to send the EOF message without closing the channel is really important.
Consider you if you want to run a command like "sendmail -t".
This command reads from stdin until it is closed (eof received) and then attempts to send the email and maybe writes data to stdout or stderr.

Could you please make the eof method available again without closing the channel?
Nov 24, 2014 at 6:38 PM
Edited Nov 24, 2014 at 6:39 PM
Reintroduced Channel.SendEof() in changeset 41014.
The new implementation is different from the original one in that it throws an InvalidOperationException when the channel is not (or no longer) open.
Nov 24, 2014 at 7:04 PM
i sightly modified it because the SshCommand class has just the IChannel interface not the class Channel.
I will create a patch tomorrow and upload it.
Nov 25, 2014 at 8:22 PM
I'll have a look at your patch tomorrow, but I'd prefer now to modify the implementation of SendEof for now.
We already have too many places where we either hide exceptions or silently ignore an invocation (eg. by doing nothing if the channel is closed).
I have less problems with this in a close or dispose context, but in all other cases it just keeps the client in the dark as to the actual reason why something failed.
Nov 26, 2014 at 6:15 PM
I added the SendEof method to IChannel.

Marked as answer by drieseng on 11/26/2014 at 10:15 AM