Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 96001 invoked from network); 22 Aug 2003 19:29:28 -0000 Received: from staff.michener.ca (66.241.132.136) by daedalus.apache.org with SMTP; 22 Aug 2003 19:29:28 -0000 Received: from Staffdom-MTA by staff.michener.ca with Novell_GroupWise; Fri, 22 Aug 2003 14:45:40 -0400 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.0.2 Date: Fri, 22 Aug 2003 14:45:33 -0400 From: "Chris Parkinson" To: , "Chris Parkinson" Subject: commons-net: TelnetClient Question Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi all, I haven't been able to find an answer to my question anywhere on the web, so this is the next place I'm checking. Hopefully someone has run into this problem before. What I'm looking for a is a way to determine when a TelnetClient connection gets dropped. I've tried using the isConnected() method inherited from SocketClient, but it returns true when the connection has definitely been dropped. Here's a code snippet: (this is from my thread that checks for available data in the InputStream) while (true) { try { // Make sure we're still connected if (!client.isConnected()) { // Break out of the loop and handle the broken connection ... } // Check for incoming data bytesAvailable = in.available(); if (bytesAvailable > 0) { // Grab the available data (the read()s don't block) ... } } catch ... ... } As I said earlier, the isConnected() method seems to always return true. Is there a different way to check the connection status, or am I using the method improperly? Any help will be *greatly* appreciated. Thanks in advance. :) -- Chris