TScSSHClient + TScSSHShell = READ LIMIT 4096 bytes ?!
Posted: Sat 18 Nov 2017 20:24
Actually I am working with the SecureBridge for few weeks. Already purchased the basic license and my application is almost working fine. Unfortunatelly at the moment I have meet one strange problem, and I was not able to solve it within several hours ... the problem is following:
I have TScSSHClient and TSCSSHShell component used in my project.
SSH2 server connection is OK, receiving and sending data is OK ...
The problem occurs when the SSHShell receive more then 4096 bytes at once!
For example when the incoming data detected via OnAsyncReceive and the length of received data is for example 4100 bytes (SSHShell.InCount inditates 4100 value) only the first 4096 bytes are processed correctly. The rest (4100-4096 = 4bytes) are mismatched and incorrect !!!
During the next OnAsyncReceive event the rest of data are received additionally. But these data is not possible to read out before the new OnAsyncReceive happens. InCount indicates 0 bytes waiting ...
I have tried several methods: SSHShell.ReceiveString(), SSHShell.ReadBuffer(), SSHShell.ReadNoWait()
Actually I am reading the buffer byte-by-byte using the method SSHShell.ReadBuffer(buffer,0,1) and building the string from recived characters ... I have also tested with delays included and everythink.
I have no more ideas.
The TScSSHClient OPTIONS properties are set to: SocketReceiveBuffer and SocketSendBuffer are both set to Receive. For the TScSSHShell I am using the NONBLOCKING MODE=TRUE
Could you please confirm that it is possible to read more then 4096 bytes received via TScSSHClient using TScSSHShell at once ??? I have no succes .. thank you very much.
I have TScSSHClient and TSCSSHShell component used in my project.
SSH2 server connection is OK, receiving and sending data is OK ...
The problem occurs when the SSHShell receive more then 4096 bytes at once!
For example when the incoming data detected via OnAsyncReceive and the length of received data is for example 4100 bytes (SSHShell.InCount inditates 4100 value) only the first 4096 bytes are processed correctly. The rest (4100-4096 = 4bytes) are mismatched and incorrect !!!
During the next OnAsyncReceive event the rest of data are received additionally. But these data is not possible to read out before the new OnAsyncReceive happens. InCount indicates 0 bytes waiting ...
I have tried several methods: SSHShell.ReceiveString(), SSHShell.ReadBuffer(), SSHShell.ReadNoWait()
Actually I am reading the buffer byte-by-byte using the method SSHShell.ReadBuffer(buffer,0,1) and building the string from recived characters ... I have also tested with delays included and everythink.
I have no more ideas.
The TScSSHClient OPTIONS properties are set to: SocketReceiveBuffer and SocketSendBuffer are both set to Receive. For the TScSSHShell I am using the NONBLOCKING MODE=TRUE
Could you please confirm that it is possible to read more then 4096 bytes received via TScSSHClient using TScSSHShell at once ??? I have no succes .. thank you very much.