Hi. I am writing a C# FTP program. I'm a hobbyist PHP programmer, and I used to instantiate a PDO connection to the MySQL server in functions that needed SQL access. I then read that it's better to pass the already open PDO object to the function.
I was curious, is that the same with the FTP object? I'm doing this (a bit pared down but gets the gist):
Is that proper? Thanks!
asked Jul 10 '15 at 22:33
I don't think there should be any problem passing around a reference to an FTP object with an connection, at least as long as the destination function is running in the same thread as where you created the FTP object.
There might be an issues with you DoEvents call though if you are performing other actions against the same FTP object in other events - they may get fired and produce unexpected results.
Chilkat would have a definitive answer though, so if you have an active support license, it might be worth checking in through the official support channel.
answered Jul 11 '15 at 11:08