In my app I have an FTP file browser, and I was wondering the following to try and acheive efficient FTP code:
Should I connect, login, perform actions, then disconnect each time I want to download/upload a file or list files?
or
Should I connect and login when the file browser is loaded, then performs actions whenever is necassary, then at the end disconnect when the file browser is closed?
or do you have any other suggestions of when to connect/disconnect?
Sorry if my question isn't good enough, or is stupid. I'm just curious as some tutorial I've seen they disconnect straight after performing an action and I wasn't sure if you should each time you perform an FTP-related action or not.
Thanks, Alex.