mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
[155026] Add hardcoded keepalives for SSH
This commit is contained in:
parent
97c0bf0c02
commit
83e30659ef
2 changed files with 8 additions and 2 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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) - [186761] make the port setting configurable
|
||||||
* Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected
|
* Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected
|
||||||
* Martin Oberhuber (Wind River) - [203500] Support encodings for SSH Sftp paths
|
* 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;
|
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 session = service.createSession(hostname, port, username);
|
||||||
//session.setTimeout(getSshTimeoutInMillis());
|
//session.setTimeout(getSshTimeoutInMillis());
|
||||||
session.setTimeout(0); //never time out on the session
|
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)
|
if (password != null)
|
||||||
session.setPassword(password);
|
session.setPassword(password);
|
||||||
session.setUserInfo(wrapperUI);
|
session.setUserInfo(wrapperUI);
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
* - copied code from org.eclipse.team.cvs.ssh2/JSchSession (Copyright IBM)
|
* - copied code from org.eclipse.team.cvs.ssh2/JSchSession (Copyright IBM)
|
||||||
* Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected
|
* Martin Oberhuber (Wind River) - [198790] make SSH createSession() protected
|
||||||
* Mikhail Kalugin <fourdman@xored.com> - [201864] Fix Terminal SSH keyboard interactive authentication
|
* Mikhail Kalugin <fourdman@xored.com> - [201864] Fix Terminal SSH keyboard interactive authentication
|
||||||
|
* Martin Oberhuber (Wind River) - [155026] Add keepalives for SSH connection
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.ssh;
|
package org.eclipse.tm.internal.terminal.ssh;
|
||||||
|
|
||||||
|
@ -67,6 +68,8 @@ class SshConnection extends Thread {
|
||||||
Session session = service.createSession(hostname, port, username);
|
Session session = service.createSession(hostname, port, username);
|
||||||
//session.setTimeout(getSshTimeoutInMillis());
|
//session.setTimeout(getSshTimeoutInMillis());
|
||||||
session.setTimeout(0); //never time out on the session
|
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)
|
if (password != null)
|
||||||
session.setPassword(password);
|
session.setPassword(password);
|
||||||
session.setUserInfo(wrapperUI);
|
session.setUserInfo(wrapperUI);
|
||||||
|
|
Loading…
Add table
Reference in a new issue