commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bradley, Todd" <>
Subject RE: cr vs. no-cr in Commons Net TelnetClient
Date Tue, 13 Jun 2006 14:46:17 GMT
I never got any responses on this, so I thought I
should update the list on what I did, just in case
anyone else runs into this in the future.  Looking
through the source to the Net library, I found the
cause of my problems, which is closely related to
a bug that's already been filed:

In the end, I modified Jakarta's TelnetClient class
to allow the user to tell it to NOT wrap the input
stream with a FromNetASCIIInputStream if they don't
want one.  That gets around the behavior that
FromNetASCIIInputStream has on Unix style machines
where it drops \r from the end of lines it's reading.


> -----Original Message-----
> From: Bradley, Todd [] 
> Sent: Friday, June 09, 2006 1:10 PM
> To:
> Subject: cr vs. no-cr in Commons Net TelnetClient
> Hi, I'm using the Commons Net TelnetClient to write an 
> interface to a network device.  This device can be queried 
> and programmed remotely through telnet, and I've got most of 
> it working.  However, the response to every command you give 
> this device ends with a carriage return (but no linefeed).  
> When I run my app on Windows XP, this carriage return is 
> passed on through to the TelnetClient's input stream, where I 
> can detect it to tell that the device is finished responding 
> to my app.  
> But when I run my app on Linux, I don't get the carriage 
> return.  And so I have no way of knowing when the device has 
> finished responding.  I'm guessing this may have something to 
> do with line termination characters, and maybe Commons Net is 
> filtering them differently on the different platforms.
> Anyone have any advice on how I can make TelnetClient work 
> the same on Linux as on Windows?
> Thanks,
> Todd.
> ----
> Todd Bradley - Polycom, Inc.
> Test Lead, Proximo Projects
> Visit me at my WebOffice for IM and app sharing:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message