Menu

#3 Timeout possibility forSshShell.Expect

open
nobody
None
5
2013-04-17
2013-04-17
No

I would find it very useful and aligned with common patterns with similar things that Expect(..) function would have timeout parameter (timeout in milliseconds).
"Whenever you are expecting something that you cannot be 100% sure of, it might happen that it never happens what you are waiting for".

I think there is a generic need for such, but I can list two specific cases additionally:
- when executing commands after one another and some of those are optional,
you cannot know for each command if you should first expect for a command prompt or not
in a common command-handling method which would take any command string as a parameter
and return the output of the command as a string.
Waiting for command prompt for some time (timeout) would help the situation.

- When executing a command to configure the IP-interface of the device, you will loose
connection with the device in the middle of command. In that case if you are waiting
for some string and have no timeout-failure option, you are in troubles (or have to use dirty methods).

Thanks for considering!

Discussion


Log in to post a comment.