diff --git a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java index 0df6d81713b..486c5d63d29 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/internal/connectorservice/ssh/SshConnectorService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [186761] make the port setting configurable * Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected * Martin Oberhuber (Wind River) - [203500] Support encodings for SSH Sftp paths + * Martin Oberhuber (Wind River) - [155026] Add keepalives for SSH connection *******************************************************************************/ package org.eclipse.rse.internal.connectorservice.ssh; @@ -88,6 +89,8 @@ public class SshConnectorService extends StandardConnectorService implements ISs Session session = service.createSession(hostname, port, username); //session.setTimeout(getSshTimeoutInMillis()); session.setTimeout(0); //never time out on the session + session.setServerAliveInterval(300000); //5 minutes + session.setServerAliveCountMax(6); //give up after 6 tries (remote will be dead after 30 min) if (password != null) session.setPassword(password); session.setUserInfo(wrapperUI); diff --git a/terminal/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java b/terminal/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java index 316755146fe..7f347fe98ff 100644 --- a/terminal/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java +++ b/terminal/org.eclipse.tm.terminal.ssh/src/org/eclipse/tm/internal/terminal/ssh/SshConnection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2007 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,6 +12,7 @@ * - copied code from org.eclipse.team.cvs.ssh2/JSchSession (Copyright IBM) * Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected * Mikhail Kalugin - [201864] Fix Terminal SSH keyboard interactive authentication + * Martin Oberhuber (Wind River) - [155026] Add keepalives for SSH connection *******************************************************************************/ package org.eclipse.tm.internal.terminal.ssh; @@ -67,6 +68,8 @@ class SshConnection extends Thread { Session session = service.createSession(hostname, port, username); //session.setTimeout(getSshTimeoutInMillis()); session.setTimeout(0); //never time out on the session + session.setServerAliveInterval(300000); //5 minutes + session.setServerAliveCountMax(6); //give up after 6 tries (remote will be dead after 30 min) if (password != null) session.setPassword(password); session.setUserInfo(wrapperUI);