commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SOMOGYI Erzsebet <r...@impulzus.sch.bme.hu>
Subject Re: [Net-Telnet] Line feed problems with login
Date Mon, 01 Aug 2005 13:19:15 GMT
Hi!

Adam Stuckey wrote:
> Is there a way to either prevent this additional "\n" being appended?  I am
> using the out.write( byte ) method rather than out.writeln( byte[] ) so I
> don't know where the additional "\n" is coming from.

I also had some \r\n problems. TelnetClient always sends \r\n as end of 
line and doesn't care if you tries to send only \r or \n.

Conversion is done in org.apache.commons.net.TelnetOutputStream in 
write(int ch) _and_ in org.apache.commons.io.ToNetASCIIOutputStream in 
write(int ch). Output stream of TelnetClient is a ToNetASCIIOutputStream 
which is initialized with a TelnetOutputStream (see _connectAction_() of 
TelnetClient).

You could try  set __convertCRtoCRLF in TelnetOutputStream to false or 
modify write method, and modify write method of ToNetASCIIOutputStream.

Finally I solved my problem on server side instead of modifing the 
source codes, so I'm not sure about this solution.

Regards,
  Rzso

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message