*) Adding timeout to ftpc.java

See: http://www.yacy-forum.de/viewtopic.php?t=2268
   

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2035 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
theli 2006-04-23 10:35:46 +00:00
parent 76ea16a6cb
commit a10072b5c0

View File

@ -96,11 +96,14 @@ public class ftpc {
// client socket for commands
private Socket ControlSocket = null;
// socket timeout
private int ControlSocketTimeout = 300000;
// socket for data transactions
private ServerSocket DataSocketActive = null;
private Socket DataSocketPassive = null;
private boolean DataSocketPassiveMode = true;
// output and input streams for client control connection
private BufferedReader clientInput = null;
private DataOutputStream clientOutput = null;
@ -1187,6 +1190,7 @@ cd ..
}
try {
ControlSocket = new Socket(cmd[1], port);
ControlSocket.setSoTimeout(this.ControlSocketTimeout);
clientInput = new BufferedReader(new InputStreamReader(ControlSocket.getInputStream()));
clientOutput = new DataOutputStream(new BufferedOutputStream(ControlSocket.getOutputStream()));
@ -1794,6 +1798,14 @@ cd ..
if (Integer.parseInt(reply.substring(0, 1)) == 5) throw new IOException(reply);
}
public int getTimeout() {
return this.ControlSocketTimeout;
}
public void setTimeout(int timeout) {
this.ControlSocketTimeout = timeout;
}
class ee extends SecurityException {