1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

[240420][terminal][ssh] Support Disconnect before connection creation

This commit is contained in:
Martin Oberhuber 2008-07-14 22:55:01 +00:00
parent 153c4b6c9d
commit 30fcb14dab

View file

@ -120,6 +120,12 @@ class SshConnection extends Thread {
if (nKeepalive > 0) {
session.setServerAliveInterval(nKeepalive); //default is 5 minutes
}
// dont try to connect if disconnect has been requested already
synchronized (this) {
if (fDisconnectHasBeenCalled)
return;
}
session.connect(nTimeout); // making connection with timeout.
// if we got disconnected, do not continue
if(!isSessionConnected())
@ -155,7 +161,7 @@ class SshConnection extends Thread {
}
private synchronized boolean isSessionConnected() {
return fDisconnectHasBeenCalled || (fSession != null && fSession.isConnected());
return !fDisconnectHasBeenCalled && fSession != null && fSession.isConnected();
}
/**