Using asynchronous code in VO

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
User avatar
Kees Bouw
Posts: 119
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Using asynchronous code in VO

Post by Kees Bouw »

Hi,

To download a large file via ftp asynchronously I tried to use the Chilkat library example which you will find here: http://www.example-code.com/csharp/asyn ... ogress.asp. The documentation for the ftp class is at https://www.chilkatsoft.com/refdoc/csFtp2Ref.html. I have translated the C# code to VO and it does not work correctly. Very often the download is not completed, the part that is downloaded is intact but in general the last kilobytes are simply missing. Sometimes a file is downloaded ok but mostly not. It is not random, meaning that a specific file is either always correct or always incorrect. I have experimented with the code but without success, which makes me wonder if asynchronous code can work at all in VO. The strange thing is that code similar to this did work for several years in our VO application until it suddenly developed the symptoms I described, a couple of months ago. So maybe an external factor like Windows updates is involved. Does anyone have any experience with using asynchronous code in VO?

Kees.
User avatar
SHirsch
Posts: 286
Joined: Tue Jan 30, 2018 8:23 am
Location: Germany

Using asynchronous code in VO

Post by SHirsch »

Hello Kees,

After some experiments with async code I ended up in creating a HelperApp where most of the dotnet stuff is handled. Our VO app creates a process with all arguments pushed in the command line, In some cases we wait for process ending, in some cases the helper app does its job an finishes without any message.
With ftp we have sometimes problems but not reproducable. We use WinSCP with a dotnet wrapper. WinScp can also be called by command line. So there is no need for any special helper app. Maybe you give it a try.

Stefan
User avatar
Kees Bouw
Posts: 119
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Using asynchronous code in VO

Post by Kees Bouw »

SHirsch wrote:After some experiments with async code I ended up in creating a HelperApp where most of the dotnet stuff is handled.
Hi Stefan,

Thank you for your reply. WinSCP looks interesting. We now use FileZilla which also seems to work fine, not sure if that has a command line option too. So your experiments with async in VO were also not successfull? What were the problems you encountered?

Kees.
User avatar
SHirsch
Posts: 286
Joined: Tue Jan 30, 2018 8:23 am
Location: Germany

Using asynchronous code in VO

Post by SHirsch »

Hi Kees,

I had some issues with:
increasing memory consumption (I am not sure if we solved this)
uncaught crashes (not reproducable)
dead locks (also not always, sometime after 10 executions, sometimes after 1000 executions)

At that time I had no time to dig deeper so I created the helper app. It was working and met our needs so there was no need to investigate further. And so we still put most of the dotnet stuff there.

Stefan
User avatar
ArneOrtlinghaus
Posts: 412
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

Using asynchronous code in VO

Post by ArneOrtlinghaus »

We use also WinSCP successfully for all types of FTP/SFTP/FTPS connections for exports and imports in our programs. There are so many different FTP derivatives and WinSCP handles them all (not all automatically, but using additional options). We even succeeded establishing a comunication with an IBM AS400.

As we started using WinSCP with VO some years ago, we still use the command line usage creating batchjobs "on the fly". But most types of FTP data exchange are batch oriented: Get me a couple of files or send a couple of files. So this is not a problem in reality. When starting with WinSCP under Dot net surely it is better to use the Dot net interface.

Arne
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Using asynchronous code in VO

Post by leon-ts »

Hi guys,
At one time, I ran into a problem in executing threads in VO (CreateVOThread). As far as I can remember now, the problem was somehow related to the GC, even if the thread function did not use dynamic memory. It looked like the GC in VO was not designed to run in threads.

To solve this problem, my colleagues and I developed our own library of parallel tasks for VO, which works using separate processes (not threads), and also takes into account various settings of the VO global environment (paths, RDDs, and much more). Even memory variables are copied from the host process to child processes. Using processes instead of threads makes it safer to write more powerful parallel tasks, since in most cases you don't have to worry about synchronizing access to objects.

So I have a solution (library) for VO SP3. There is also a ported version of this library in X#. If you are still interested in this topic (note that the VO library is for SP3, not the latest SP4) - let me know. I will need some time to prepare the export version of this library (English translation and removal of some specific parameters for my projects).

Best regards,
Leonid
Best regards,
Leonid
Post Reply