You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ge...@apache.org on 2007/11/23 10:14:33 UTC
svn commit: r597608 -
/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FTPClientPool.java
Author: gertv
Date: Fri Nov 23 01:14:32 2007
New Revision: 597608
URL: http://svn.apache.org/viewvc?rev=597608&view=rev
Log:
SM-915: FTP poller stalls with threads waiting on PlainSocketImpl.socketAccept()
Modified:
servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FTPClientPool.java
Modified: servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FTPClientPool.java
URL: http://svn.apache.org/viewvc/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FTPClientPool.java?rev=597608&r1=597607&r2=597608&view=diff
==============================================================================
--- servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FTPClientPool.java (original)
+++ servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-ftp/src/main/java/org/apache/servicemix/ftp/FTPClientPool.java Fri Nov 23 01:14:32 2007
@@ -33,11 +33,14 @@
*/
public class FTPClientPool extends SocketClientPoolSupport {
+ public static final int DEFAULT_DATA_TIMEOUT = 120000; // two minutes
+
private String username;
private String password;
private boolean binaryMode = true;
private boolean passiveMode = false;
private FTPClientConfig config;
+ private int dataTimeout = DEFAULT_DATA_TIMEOUT;
public boolean validateObject(Object object) {
FTPClient client = (FTPClient) object;
@@ -107,6 +110,20 @@
this.config = config;
}
+ /**
+ * @return the dataTimeout
+ */
+ public int getDataTimeout() {
+ return dataTimeout;
+ }
+
+ /**
+ * @param dataTimeout the dataTimeout to set
+ */
+ public void setDataTimeout(int dataTimeout) {
+ this.dataTimeout = dataTimeout;
+ }
+
// Implementation methods
//-------------------------------------------------------------------------
protected void connect(SocketClient client) throws Exception {
@@ -115,6 +132,8 @@
if (config != null) {
ftp.configure(config);
}
+ ftp.setDataTimeout(getDataTimeout());
+
super.connect(client);
int code = ftp.getReplyCode();