something strange in blocking mode - WeOnlyDo Discussion board

something strange in blocking mode (wodSSH / wodSSH.NET)

by fox, Wednesday, February 22, 2006, 08:55 (6647 days ago)

My code perform these actions:

1. Sends something in non-blocking mode via Send method (like 'ls' typed by user);
2. Receives server's answer ( non_block answer ) with OnReceived-notification and detects (manually) that server sends prompt;
3. switches to blocking mode and enables StripANSI;
4. result_one := Execute('ls -la'#13,prompt,timeout);
5. result_two := Execute('pwd'#13,prompt,timeout);
6. switches back to non-blocking mode and disables StripANSI;

The results I got is unstable .

Most of the times it's all ok and I receive the correct info, but sometimes (approx. 1 of 5 tries) the result_one looks like the non_block answer with small differences (and the result isn't stripped from ANSI-sequences) and the result_two is ls -la + CRLF + correct result_one ;

I debug alot but still cannot understand what happens... Could you explain it?

Re: something strange in blocking mode

by wodSupport, Wednesday, February 22, 2006, 16:37 (6646 days ago) @ fox

Fox,

really hard to say without trying. Can we try your code from here?

What do you put in Prompt pattern in Execute event? Can you try using #10 (LF) instead of #13 (CR)?

Are you sure that before calling first execute, nothing arrived on the socket as remainder of previous calls? Also, are you sure nothing is still available but you didn't receive it?

Kreso