EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Attempt to call synchronous method in asynchronous mode and vice versa

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?
Posted: 12/12/2012 01:03:38
by Ken Ivanov (Team)

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?



Topic viewed 1514 times

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


Back to top

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

Got it!