You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Mark Frimston <ma...@adinsight.com> on 2012/10/15 15:25:50 UTC

[net] TelnetClient dropping bytes?

Hi

I'm using TelnetClient to send and receive commands from a server, each 
command consisting of character data followed by a newline. However, at 
seemingly random times the response obtained from TelnetClient's 
InputStream appears to have bytes missing, or sometimes includes extra 
bytes.

I was able to reproduce the problem on Ubuntu, Windows and OSX and I am 
using commons-net version 3.1 and Oracle's 1.6 JDK.

I'm not sure if this is a bug or whether I'm just not using TelnetClient 
correctly, as I was unable to find any previous reports of similar 
problems. I've attached the simple test program I used to recreate the 
issue. The program connects to a basic socket server in a loop until the 
message echoed back is not the same as the one sent, which I've seen 
happen anywhere between 2-400 iterations.

Can anybody confirm the problem or else point out what mistake I've made?


Many thanks,

Mark