Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Dealing with "prompts"

$
0
0
@Jelly,

There are many examples from the users here in the discussions to do all kinds of things. There is certainly an example in the discussions, docs, or tests/source to do with what you are trying to get working.

But there are a myriad of things not involved with the SSH library that could be in your way. I mean, one thing could easily be that you are talking to a router or server that requires a CR, LF, or CRLF in order to get your commands. Also, ssh needs to know when the other side is 'done'. As another poster asked, you can do this with a timer, the stream not growing after x time, a timeout, etc.

I wrote a wrapper a while back that reset a timer to 0 whenever there was activity on the stream. If the timer expired, it meant that I wasn't going to wait any longer for any more data, and I proceeded with what I got to that point.

What debugging have you done to see (maybe even on the host) what it might be expecting next, or if it has even given up?

I'm just trying to say, that it is actually more complicated to logon & do commands than most people (me included) realize. That of course means a lot more places to go wrong! :)

So when it works, nobody says anything, but when it fails...!

So if you can provide a bit more detail on the environment, logs/debugging, and pinpointing the place at which the thing breaks down, it makes it a lot easier to offer help. Right now, the code above might just work for me, but I'd be running it on a host not like yours... :)

Not trying to be depressing, just hoping to get more info about your issue! :)

code is poetry.

pat
:)

Viewing all articles
Browse latest Browse all 1729

Trending Articles