EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Attempt to call synchronous method in asynchronous mode and vice versa

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#22779
Posted: 12/11/2012 16:41:36
by Tim Molloy (Standard support level)
Joined: 11/13/2009
Posts: 21

I am using a static implementation of TElSimpleSFTPClient, which to my understanding is synchronous only, correct?

I have a solution which performs file downloads for potentially multiple user accounts at the same sftp location. I am allowed one connection per user account at a time. I can have 1 to many files to download per account. Therefore, I have engineered a solution that will execute many asynchronous operations of synchronous downloads. Basically, it's one asynch thread per login account which loops through and downloads each file for that user account.

During it's maiden run, there was 1 file to download for each of 7 different user accounts. It fired up 7 threads (one for each account) and all failed with error "SBSimpleSftp.EElSimpleSFTPClientError: Connection failed (error code is -1)" but one, which downloaded successfully. This leads me to think that I can only perform synch operations at the server level...is this correct?
#22783
Posted: 12/12/2012 01:03:38
by Ken Ivanov (EldoS Corp.)

Hello Tim,

Indeed, TElSimpleSFTPClient implements a synchronous ideology, yet it can be used in asynchronous environments too - in particular, in environments where asynchrony is achieved by placing individual instances of the component into their own threads.

The exception you are getting is usually thrown if the component was unable to establish a network connection to the server. This makes me assume that the problem might have something to do with a firewall or router that restrict the number of outbound connections originating from the same source. Could you please run a small check for us to confirm or reject this assumption - please try to establish two connections to the server with two TElSimpleSFTPClient objects from the same thread (in order), and check if both are able to connect.

If the synchronous solution will work, may I please ask you to send us a small sample project that we could use to reproduce the issue locally?

Reply

Statistics

Topic viewed 1294 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!