ShellStream.ReadLine causes _socket.Receive to return zero, resulting in SshConnectionException

Mar 29, 2014 at 5:05 PM
I'm calling ShellStream.Readline in my code after sending a command, but if I then loop and call ReadLine, I find that the _socket.Receive call in Session.NET.cs returns zero bytes read and hence throws the shConnectionException exception.

I'm trying to figure out why this is happening but so far no luck. It seems this should not happen because ReadLine only reads from the _incoming buffer, which in turn only gets filled when a ChannelDataMessage is received. This is at a higher level than the socket itself so it is unclear to me why the socket's data gets stolen by the ReadLine call.

Any ideas?
Mar 29, 2014 at 5:32 PM
OK nevermind. I believe this is happening because the channel is closed due to an improperly handled authentication request. I will post a new thread for that issue since it is quite different from this issue.
Marked as answer by BitFlipper on 3/29/2014 at 10:32 AM