1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-16 21:45:22 +02:00

bug 277061: [terminal] TelnetConnection.isConnected() should check if socket was not closed

https://bugs.eclipse.org/bugs/show_bug.cgi?id=277061
This commit is contained in:
Michael Scharf 2009-05-21 02:59:22 +00:00
parent d9df109da5
commit 6b1f08b2f5

View file

@ -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 * 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 @@
* Michael Scharf (Wind River) - split into core, view and connector plugins * Michael Scharf (Wind River) - split into core, view and connector plugins
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified * 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) - [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; package org.eclipse.tm.internal.terminal.telnet;
@ -237,7 +238,7 @@ public class TelnetConnection extends Thread implements TelnetCodes {
* connected, false otherwise. * connected, false otherwise.
*/ */
public boolean isConnected() { public boolean isConnected() {
return socket != null && socket.isConnected(); return socket != null && socket.isConnected() && !socket.isClosed();
} }
/** /**