From 6b1f08b2f5ad67529b0ee27bce6763f4c01c2aab Mon Sep 17 00:00:00 2001 From: Michael Scharf Date: Thu, 21 May 2009 02:59:22 +0000 Subject: [PATCH] bug 277061: [terminal] TelnetConnection.isConnected() should check if socket was not closed https://bugs.eclipse.org/bugs/show_bug.cgi?id=277061 --- .../tm/internal/terminal/telnet/TelnetConnection.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/terminal/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnection.java b/terminal/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnection.java index 50e53e8f000..a630f99d800 100644 --- a/terminal/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnection.java +++ b/terminal/org.eclipse.tm.terminal.telnet/src/org/eclipse/tm/internal/terminal/telnet/TelnetConnection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 Wind River Systems, Inc. and others. + * Copyright (c) 2005, 2009 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 @@ * Michael Scharf (Wind River) - split into core, view and connector plugins * Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Michael Scharf (Wind River) - [209665] Add ability to log byte streams from terminal + * Michael Scharf (Wind River) - [277061] TelnetConnection.isConnected() should check if socket was not closed *******************************************************************************/ package org.eclipse.tm.internal.terminal.telnet; @@ -237,7 +238,7 @@ public class TelnetConnection extends Thread implements TelnetCodes { * connected, false otherwise. */ public boolean isConnected() { - return socket != null && socket.isConnected(); + return socket != null && socket.isConnected() && !socket.isClosed(); } /**