Re: Receive problem in SSH - WeOnlyDo Discussion board

Re: Receive problem in SSH (General questions)

by wodSupport, Friday, January 13, 2006, 20:25 (6686 days ago) @ wodSupport

Also, I am finding my Received() event does not get fired until I actually make the call to Receive() - this is not very helpful to me.

This should not be happening. However, if you call Sleep and have blocked the thread, then it makes sense since event wasn't fired at all - since nothing was processed due to Sleep.

Finally, I have experimented with calling SetTimeout(5) before calling Receive(), which throws an exception as expected if the server does not have anything to send me, but WODSSH disconnects me!

Ok, this sounds strange, I'll check it out on next few hours. It makes sense to happen due to programming logic (timeout, set by timeout property, did expire...) but doesn't make sense from end-user logic - so this probably needs to be fixed.

I really need to use Receive() instead of WaitFor() or ReceiveLine() since I am getting byte arrays from the server.

WaitFor change will change today also. If it expires, due to timeout, it will not consume everything from the buffer, like it did so far. Perhaps that will help?

What I need is for Receive() to support a model where I need to read a variable amount of data from the server, where the only way I know the server is done sending is when I do not receive any data for about 5 seconds or so.

Ok, so setting Timeout = 5, calling Receive, getting error but NOT disconnecting is the behaviour you expect? Me too - I'll check it out to make it happen.


Complete thread: