I'm uploading lots of files (about 2000) using Commons-net FTPClient.
I'm checking connection before each upload using isAvailable()
& isConnected()
methods and reconnect if connection closed.
after uploading some files (variable) storeFileStream
returns null
(that means "data connection cannot be opened" as javadoc) while isAvailable()
& isConnected()
both are true !!
What is the problem?
How can I check data connection availability?
Thanks
How can I check data connection availability?
Try to use it. There is no 'dial tone' in TCP, so methods with names like isConnected()
can't do anything more than tell you (1) whether you have ever connected, and, if you're lucky, (2) whether you have subsequently closed the connection or encountered an I/O error on it. I'm not familiar with the API you mention but the isConnected()
methods of the JDK classes don't do anything beyond (1).