EldoS | Feel safer!

Software components for data protection, secure storage and transfer

WebDavClient not threadsafe?

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#34579
Posted: 09/30/2015 18:07:55
by Keith Yates (Basic support level)
Joined: 04/07/2015
Posts: 6

I was testing out the webdavclient and was getting a connection lost error on every thread that wasn't the main when they tried to make any calls, wrapping them in a lock(webdavclient) call fixed all the issues. Is this intended or do I need to enable some flag to allow for multiple webdav connection calls at once?
#34580
Posted: 10/01/2015 02:47:30
by Eugene Mayevski (EldoS Corp.)

Each transport component must be used in one thread, but it can be any thread (not necessarily the main one). This also means only one concurrent use of the transport. If you need to connect to two servers at the same time, you create two threads and two transports.

Note that on most platforms you can't safely access GUI objects from the secondary threads, and thus from the event handlers triggered by the transport component. So if you update the UI from the event handler, you need to take special measures depending on your platform.


Sincerely yours
Eugene Mayevski
#34584
Posted: 10/01/2015 18:34:22
by Keith Yates (Basic support level)
Joined: 04/07/2015
Posts: 6

So just to make sure I'm understanding correctly, it's intended that I couldn't simultaneously download 2 files?
#34585
Posted: 10/02/2015 00:17:50
by Eugene Mayevski (EldoS Corp.)

Maybe my explanation was not clear enough. You can perform any number of operations in parallel, when they are performed by different instances of TElWebDAVClient class in different threads. So you do can download two files t the same time, just not with one object.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 3006 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!