Page 1 of 1

Suggestion ScSSHShell dont use tbytes, use tstringstream

Posted: Sat 07 Sep 2019 23:36
by kaffeburk
Hello,

After a few hours i got ScSSHShell1.ReadNoWait to work. You use tbytes, that perhaps can be described as an ancient technique? My oldest bok from 2005 dosen't cover it.

To find that I must write ReadNoWait(aTbytes[0],MyLength); and not just ReadNoWait(aTbytes,MyLength) did take a lot of research, also how to convert to a string "SetString(aString, PAnsiChar(@aTbytes[0]), Length(aTbytes))" was not easy. Most exempels dealt with tbytes already in ANSI.

Why not just use a TstringStream instead of tbytes?

Re: Suggestion ScSSHShell dont use tbytes, use tstringstream

Posted: Tue 10 Sep 2019 10:32
by ViktorV
Thank you for the information and contributing to our product development.
You can use this method with the TBytes type: TScSSHCustomChannel.ReadNoWait(var Buffer: TBytes; const Offset, Count: integer).
Also you can use the TScSSHCustomChannel.ReadString method to handle strings.
We'll add a possibility to use this method with the parameter of type TStream in a future version of SecureBridge.