1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

Terminal: Fix - Telnet connector prints confusing "Connection refused"

Telnet connector prints "Connection refused" to terminal control while the terminal is already disconnected again. This is very confusing for the user and should be avoided.
This commit is contained in:
uwe 2013-10-18 15:42:05 +02:00
parent 22f120d970
commit e4e56199ef

View file

@ -93,8 +93,11 @@ class TelnetConnectWorker extends Thread {
connectFailed(socketTimeoutException.getMessage(), "Connection Error!\n" + socketTimeoutException.getMessage()); //$NON-NLS-1$
} catch (ConnectException connectException) {
// In case of a ConnectException, do a re-try. The server could have been
// simply not ready yet and the worker would give up to early.
if (remaining == 0) connectFailed(connectException.getMessage(),"Connection refused!"); //$NON-NLS-1$
// simply not ready yet and the worker would give up to early. If the terminal
// control is already closed (disconnected), don't print "Connection refused" errors
if (remaining == 0 && TerminalState.CLOSED != fControl.getState()) {
connectFailed(connectException.getMessage(),"Connection refused!"); //$NON-NLS-1$
}
} catch (Exception exception) {
// Any other exception on connect. No re-try in this case either
remaining = 0;