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

New Post: VB.net SSH client with VB.net

$
0
0
@bgengine,

I might suggest start messing with it to start.

I have posted many VB examples here. I will leave it to the experts to say for sure, but networking protocols don't talk the way hard-wired ones do. The buffer you're talking about in the serial world, when talking about the network world, is not a static thing that you can say "OK, it's empty". There is no way of knowing if another packet will arrive, and the 'buffer' be filled again.

I have described my approaches here, but basically there are 2 approaches (I alluded to them earlier). The subtlety being whether you know what to expect or not, and whether the response is really gig, or very small-or not at all. That alone can open a large discussion...

So what I do MOST of the time with a response I know will be large is this:
  1. I issue a command.
  2. I wait for the response (might take time, so I need to set a timer to decide "I give up waiting").
  3. If that timeout is not yet, I RESET an 'inactivity' timer to 0 every time I receive something.
  4. That inactivity timer also has a timeout period to say "I guess there is no more output!".
  5. As long as there is input, and the inactivity timer are below threshold, I continue to add to the input stream (the content I expected).
  6. At some point, one of the timers will expire, and I can't wait any longer. I put these timeouts in the Function() calls, as Optional with defaults.
  7. I return whatever I clumped together.
This works in my scenarios because I am not using SSH for files (I guess I could), but for text in/out, as in commands & responses. Most folks here are doing things much more exotic than I am-hell, I can't even figure out how to write tests! :)
  • So again, I suggest you put a small test project in your solution, and try (with Intellisense) a few options... And go back and read some of the excellent threads here where folks have posted their working code (like me) for your benefit. I didn't post it to help me, but to help you. :)
I think you will make much faster progress, and understand your choices for your scenario better. I chose this SSH util suite because it is current, useful & well written, and the support/forum/community is active. Sometimes I pose bizarre problems that nobody knows how to fix, but most times folks are eager to assist-probably a lot more so than on the elitist SO...

Go until you can't continue, try others' solutions, and when you get to a line/step you can't get past, post here.

pat
:)

Viewing all articles
Browse latest Browse all 1729

Trending Articles