SFTPClient NoBlocking:=true

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
bipbip59
Posts: 5
Joined: Wed 03 Apr 2019 14:07

SFTPClient NoBlocking:=true

Post by bipbip59 » 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

bipbip59
Posts: 5
Joined: Wed 03 Apr 2019 14:07

Re: SFTPClient NoBlocking:=true

Post by bipbip59 » 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?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SFTPClient NoBlocking:=true

Post by ViktorV » Thu 04 Apr 2019 15:02

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

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SFTPClient NoBlocking:=true

Post by ViktorV » Thu 04 Apr 2019 15:02

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?

bipbip59
Posts: 5
Joined: Wed 03 Apr 2019 14:07

Re: SFTPClient NoBlocking:=true

Post by bipbip59 » Fri 05 Apr 2019 06:56

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.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SFTPClient NoBlocking:=true

Post by ViktorV » Fri 05 Apr 2019 14:47

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.

Post Reply