Re: Receive problem in SSH - WeOnlyDo Discussion board

Re: Receive problem in SSH (General questions)

by wodSupport, Friday, January 13, 2006, 20:18 (6889 days ago) @ Jeff

Jeff,

our waitfor under the hood isn't that smart at all. It's loop of Receive calls until expected string arrives. You can make your own (better) function like that if you need it a bit different.

So I was hoping to use Receive() with a small timeout, but if it times out then WODSSH will internally disconnect the session!! Is there any way to timeout without disconnecting, so I can call Receive() again.

No, wodSSH will not internally disconnect the session. Hmm. Let me think.. It should not. Timeout expires, I agree, and Timeout property is there for auto-disconnect for inactivity.. But.. Hmm.. Not sure, I would have to check this.


And why does Peek() never return any data, and DataReady() always return 0? This doesn't make sense because if I then immediately do a call to Receive() it gets data.

I don't know, I didn't personally try this so I cannot answer. If something is in the buffer it would be returned. If it's not, Peek will return immediately. Receive is a blocking method, so it will actually wait for something to arrive - perhaps this is a matter of (milli)seconds but enough to get unexpected resuts.

It seems having the WODSSH object in the same thread as the main program does not really work as expected - it seems you need some sort of function that client code can call to tell the WODSSH object to process events (such as reading data into buffers, updating the data ready count, etc).

I have asked these questions in my previous posts but you did not address them - can you please give some insight?

Sorry, I somehow missed them. I'll answer now.


Complete thread: