Page 1 of 1

SFTPClient NoBlocking:=true

Posted: Wed 03 Apr 2019 14:13
by bipbip59
Hello,
I am testing SecureBridge with the SFTPClient sample.
It works.
But if I activate the SFTPClient.NoBlocking property: = true
The "Start SFTP" does not work anymore.

Can you help me ?
Thank you

Re: SFTPClient NoBlocking:=true

Posted: Thu 04 Apr 2019 09:30
by bipbip59
I'm studying the component SFTPClient , I really do not see how to execute for example the command dir, without blocking?
Is it really done for that?

Re: SFTPClient NoBlocking:=true

Posted: Thu 04 Apr 2019 15:02
by ViktorV
bipbip59 wrote: Wed 03 Apr 2019 14:13 Hello,
I am testing SecureBridge with the SFTPClient sample.
It works.
But if I activate the SFTPClient.NoBlocking property: = true
The "Start SFTP" does not work anymore.

Can you help me ?
Thank you
Our SFTPClient demo is designed to run when the TscSFTPClient.NoBlocking property is set to False. Since the example code uses code

Code: Select all

while not ScSFTPClient.EOF (Handle) do
this code will work correctly only TscSFTPClient. NoBlocking is set to False: https://devart.com/sbridge/docs/tscsftpclient_eof.htm

Re: SFTPClient NoBlocking:=true

Posted: Thu 04 Apr 2019 15:02
by ViktorV
bipbip59 wrote: Thu 04 Apr 2019 09:30 I'm studying the component SFTPClient , I really do not see how to execute for example the command dir, without blocking?
Is it really done for that?
Please give a more detailed description of the question and specify what you mean by the phrase "the command dir": call TscSFTPClient.ReadDirectory method or something else?

Re: SFTPClient NoBlocking:=true

Posted: Fri 05 Apr 2019 06:56
by bipbip59
I would like to run the ScSFTPClient component in mode NoBlocking: = true.

At first, succeed in making OpenDirectory function.

This work's good with NoBlocking: = false.

Code: Select all

  AnsiString RootDir;

  TScSFTPFileHandle Handle;
  Handle = ScSFTPClient->OpenDirectory("/test");
  while (!ScSFTPClient->EOF(Handle))
  {
		ScSFTPClient->ReadDirectory(Handle);
  }
  ScSFTPClient->CloseHandle(Handle);
But it doesn't work with NoBlocking = true.

Re: SFTPClient NoBlocking:=true

Posted: Fri 05 Apr 2019 14:47
by ViktorV
As we wrote to you earlier, when the NoBlocking property is set to True, the code while (!ScSFTPClient->EOF(Handle) does not have any sense. Our demo example is designed to be run when the NoBlocking property is set to False. If NoBlocking is set to True, you should use the required event handlers to ensure correctness of work. For example, after calling OpenDirectory in the NonBlocking mode, you need to process the TScSFTPClient.OnOpenFile even: : https://devart.com/sbridge/docs/tscsftp ... nDirectory
Please refer to the official SecureBridge documentation for more details.