LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CopyFile in a new thread?

I'm wondering if this is the best approach for an unstable/unreliable network connection.

 

My application occasionally sees very long file copy times and I have up to 16 units under test for which to copy.  This presents a huge GUI lag as there's no timeout parameter I can use in CopyFile.

 

I'm thinking about putting that into a separate thread and then check for the thread to complete in a timer.

 

Sound reasonable?

0 Kudos
Message 1 of 2
(1,078 Views)

I would say it’s a valid approach. Of course it’s a bit of a workaround. It would be best to research the reason for the delay such as a possibly badly configured network setup. The IP protocol is pretty amazing in how it can recover even from pretty borked network setups but it may take significant time. Its original development purpose was military oriented and to provide reliable communication even with heavily damaged communication infrastructure that could dynamically change. Communication speed was not a concern initially and instantaneous turn-around times even less.

Of course those delays could be legitimate, such as other high burst data transfers over the same line or the remote device being overloaded, but workarounds without knowing the reason for them usually will come back later and bite your ass in some way!

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(1,036 Views)