commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Ramirez <bramir...@hotmail.com>
Subject RE: How to tell when TelnetClient has finished receiving
Date Wed, 03 Jun 2009 13:05:37 GMT

You can check the available characters on the input stream like this

 

if (in.available() == 0) {

  // Nothing left on the stream to read

}

 

It's probably better to check for a terminating token since the test above does not guarantee
that the sender is done sending, only that there is nothing else to read at the time of the
check.
 
> From: itsupport@martinjonkersmotors.com.au
> To: user@commons.apache.org
> Subject: How to tell when TelnetClient has finished receiving
> Date: Wed, 3 Jun 2009 11:34:34 +1000
> 
> Hi,
> 
> 
> 
> Is there a way to determine when the TelnetClient has finished receiving
> everything via the input stream? I'm trying to use SendAYT() method, but it
> appears to be a very messy way of checking.
> 
> 
> 
> Regards,
> 
> 
> 
> Dale Harris
> 
> IT Support
> 
> Martin Jonkers Motors
> 
> Morayfield Qld 4506
> 
> Ph: 07 5495 1844
> 
> 
> 

_________________________________________________________________
Windows Liveā„¢: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message