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:
http://issues.apache.org/bugzilla/show_bug.cgi?id=34763 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. Todd. > -----Original Message----- > From: Bradley, Todd [mailto:[EMAIL PROTECTED] > Sent: Friday, June 09, 2006 1:10 PM > To: [email protected] > 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: > http://www.polycomweboffice.com/[EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
