@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:
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
:)
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:
- I issue a command.
- I wait for the response (might take time, so I need to set a timer to decide "I give up waiting").
- If that timeout is not yet, I RESET an 'inactivity' timer to 0 every time I receive something.
- That inactivity timer also has a timeout period to say "I guess there is no more output!".
- 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).
- 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.
-
I return whatever I clumped together.
-
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. :)
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
:)