Hello, how do you set a timeout on the client side ?
My ftp server times out after 5 minutes, normally the connection restarts as expected. My code runs inside a background service that is running 24/7 so there are a lot of things that can cause an 'unexpected' IOException. A physical network is never perfect.
Im using bea jrockit jvm that is 1.4 compatible
Im using commons-net 1.4
Yes it seems that isConnected() that is used in FTPClientWrapper does not do a physical test. I think i will try to replace

all catch blocks

catch (FTPConnectionClosedException e)

with

catch(IOException e)

in FTPClientWrapper

FTPConnectionClosedException is a subclass of IOException so there is no need to have two catch blocks.
Hope this will be fixed in official future releases of commons-VFS

Regards

Andrew Elcock wrote:

What I did to get round this is to apply a timeout and after a certain time I "restart" the connection. I hope this works for you to...

Mario Ivankovits wrote:

Hi!

Caused by: java.net.SocketException: Broken pipe


Do you know why this happens? Some sort of ftp timeout?

       catch (IOException ie)
       {
           disconnect();
           throw ie;
       }


I ask as maybe we should retry the operation here too?


Normally isConnected() should fail then, but it seems that it still returns true


isConnected() in ftp.java is a logical operation if the connection "should be" established, not a physical check. There is also a socketIsConnected which tries to check if the connections is really alive but it works only with jdk1.4 and up.

Which jdk do you use?
If its 1.4 or up, which commons-net version do you use?

---
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to